Skip to content

Conversation

@lbh930
Copy link

@lbh930 lbh930 commented Nov 18, 2025

Description

Modified AbstractMarshallableCfgTest.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 net.openhft.chronicle.wire.AbstractMarshallableCfgTest.asString and the cause was that the test 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 failure is attached.
nondex_output_AbstractMarshallableCfgTest.txt

@lbh930 lbh930 changed the title Stabilize AbstractMarshallableCfgTest by removing dependence on field… De-flake AbstractMarshallableCfgTest by removing dependence on field… Nov 18, 2025
@lbh930 lbh930 force-pushed the fix_abstract_marshallable_cfg_test branch from ef0f34e to 656fe28 Compare November 18, 2025 22:28
@lbh930 lbh930 force-pushed the fix_abstract_marshallable_cfg_test branch from 656fe28 to daa72e7 Compare December 2, 2025 20:33
@lbh930
Copy link
Author

lbh930 commented Dec 2, 2025

This PR is updated to make changes minimal.

@lbh930 lbh930 changed the title De-flake AbstractMarshallableCfgTest by removing dependence on field… Fix flaky test in AbstractMarshallableCfgTest by removing dependence on field… Dec 2, 2025
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