Skip to content

Conversation

cperkkk
Copy link
Contributor

@cperkkk cperkkk commented Oct 21, 2025

What is the purpose of this PR?

This pull request addresses 1 flaky test, in the jackson-dataformats-binary project. The test was failing intermittently due to assumptions about the ordering of fields returned by the code under test.

Test Affected

  • IonValueDeserializerTest#shouldBeAbleToSerializeAndDeserializeIonValueDataWithIncludeNonNull

Why the test fails

The test compares the exact string representation which can be returned in any order (when using HashMap in the underlying implementation). I switched the test to use LinkedHashMap instead to guarantee ordering.

String data = mapper.writeValueAsString(source);
        assertEquals("{a:1,b:null}", data);

How to reproduce the test failure

Use the TestingResearchIllinois's NonDex tool and run:

mvn edu.illinois:nondex-maven-plugin:2.1.7:nondex 

Before the fix, the test failed intermittently with errors similar to:

tools.jackson.dataformat.ion.ionvalue.IonValueDeserializerTest:org.opentest4j.AssertionFailedError: expected: <{a:1,b:null}> but was: <{b:null,a:1}>

Expected results

The test should pass consistently, regardless of the order of fields in the returned response.

Actual results

Before the fix, the test failed intermittently due to changes in the order of the returned response.

Validation

Test Results

  • Tests run with NonDex: Passed consistently across multiple seeds
mvn edu.illinois:nondex-maven-plugin:2.1.7:nondex 
image

Additional Notes

  • The fix ensures the test is robust to non-deterministic behaviors and compatible with future updates to it or related dependencies.

Let me know if further improvements or clarifications are needed!

cowtowncoder added a commit that referenced this pull request Oct 22, 2025
@cowtowncoder cowtowncoder merged commit f0fa86b into FasterXML:3.x Oct 22, 2025
3 checks passed
@cowtowncoder
Copy link
Member

Thank you @cperkkk !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants