Skip to content

Conversation

@lycoris106
Copy link

@lycoris106 lycoris106 commented Dec 4, 2025

Description

This PR fixes some flaky tests found with NonDex, which explores non-determinism in tests. These tests can fail under different JVMs, hash seeds, etc.

The flaky tests:

  • RealtimeSpeechClientTest.testOnConnectAndClose

Root Cause

In the test testOnConnectAndClose, the assertion assumes a fixed order of fields in the json string. However, JSON serialization depends on non-deterministic map iteration order and can place testKey before or after uri:

expected:<...ENT_ID","headers":{"[testKey":"testValue","uri":"wss://test-endpoint.com/ws/transcribe/stream]"}}> but was:<...ENT_ID","headers":{"[uri":"wss://test-endpoint.com/ws/transcribe/stream","testKey":"testValue]"}}>

Fix

We use a safer way to compare jsons, by parsing them into jackson's JsonNodes.

Failure Reproduction

  • Java version:
    openjdk 21.0.8 2025-07-15
    OpenJDK Runtime Environment (build 21.0.8+9-Ubuntu-0ubuntu124.04.1)
    OpenJDK 64-Bit Server VM (build 21.0.8+9-Ubuntu-0ubuntu124.04.1, mixed mode, sharing)
    
  • OS version:
    Ubuntu 24.04.3 LTS

Build with the main branch and run tests with NonDex to observe the failure, for example:

mvn edu.illinois:nondex-maven-plugin:2.2.1:nondex -pl bmc-objectstorage/bmc-objectstorage-extensions \
    -Dtest=RealtimeSpeechClientTest -DnondexRuns=10 \
    -Djacoco.skip -Drat.skip -Dpmd.skip -Denforcer.skip

Notes

  • This fix only modifies test code but no production code

Signed-off-by: Chih-Fu Lai <lycoris1062@gmail.com>
@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Dec 4, 2025
@oracle-contributor-agreement
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant