Skip to content

[BUG] - Flaky test CommonExceptionDataTest#should_include_code_in_json_when_code_is_not_null #4991

Description

@pem70

Steps to Reproduce

The test should_include_code_in_json_when_code_is_not_null in CommonExceptionDataTest from module swagger/swagger-invocation/invocation-core is flaky. It compares the exact JSON string output, which can vary in key order when serialized from a Map or object without guaranteed ordering. Different JVMs or JSON libraries may produce a map with different key order, causing intermittent failures even though the data is semantically identical.

This test was flagged via the NonDex tool, which detects potentially unreliable tests due to underlying Java API assumptions. To see the Nondex output for this test, run:

mvn -pl swagger/swagger-invocation/invocation-core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.apache.servicecomb.swagger.invocation.exception.CommonExceptionDataTest#should_include_code_in_json_when_code_is_not_null

Expected Behavior

The test should pass for map with semantically identical data but different key order.

Servicecomb Version

3.3.0

Additional Context

I have a potential fix in a PR, and I'll add that to the discussion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions