Skip to content

Conversation

@lbh930
Copy link

@lbh930 lbh930 commented Nov 18, 2025

Description

Modified Base64Test.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.converter.Base64Test.onAnField 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 test failure is attached.
nondex_output_base64test.txt

@lbh930 lbh930 force-pushed the fix_base64test_flakiness branch 2 times, most recently from 101142a to 282e10a Compare December 2, 2025 20:21
@lbh930
Copy link
Author

lbh930 commented Dec 2, 2025

This PR is updated to make changes shorter.

@lbh930 lbh930 force-pushed the fix_base64test_flakiness branch from 282e10a to ab85129 Compare December 2, 2025 20:38
@lbh930 lbh930 changed the title De-flake Base64Test by removing dependence on field ordering Fix flaky test in Base64Test by removing dependence on field ordering 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