Skip to content

Conversation

@lbh930
Copy link

@lbh930 lbh930 commented Dec 2, 2025

Description

Modified StreamsDemoTest.java to sort the serialized fields before comparing them with the expected output. This ensures that the test is deterministic and doesn't depend on the iteration order of Class.getDeclaredFields(), which does not guarantee consistency.

Motivation

NonDex detected test flakiness in 2 tests:

  • net.openhft.chronicle.wire.domestic.streaming.streams.StreamsDemoTest.streamTypeMarketDataSimple
  • net.openhft.chronicle.wire.domestic.streaming.streams.StreamsDemoTest.streamTypeMarketDataSimpleWIthInvalid

This PR is verified by NonDex to fix them all. The root cause was that the tests asserted a specific order of fields in the serialized YAML string. Since `SelfDescribingMarshallable` uses reflection to discover fields, the order is not guaranteed. An example of NonDex output with detected test failures is attached.

nondex_output_StreamsDemoTest.txt

@lbh930 lbh930 force-pushed the fix_flaky_streams_demo_test branch 3 times, most recently from 0735d2c to 2793262 Compare December 2, 2025 20:54
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.

1 participant