Skip to content

Conversation

@lbh930
Copy link

@lbh930 lbh930 commented Nov 18, 2025

All test methods in LongConvertorFieldsTest (base16, base64, base85, shortText, words) were comparing exact string representations of serialized YAML. Such tests are prone to flakes since the underlying implementation relies on reflection (getDeclaredFields()), which does not guarantee a deterministic field order across JVMs or environments.

Summary of Changes

Refactored doTest() to use regex-based YAML parsing that extracts field-value pairs into a HashMap for order-independent validation. This approach validates the same semantics while being resilient to field ordering variations.

Test Flakiness Reproducibility

The issue can be observed on environments where getDeclaredFields() returns fields in a different order than expected. Such flakiness is observed using NonDex.

…ring

All test methods (base16, base64, base85, shortText, words) were comparing
exact string representations of serialized YAML, which included fields in an
undefined order from Class.getDeclaredFields(). This caused tests to fail
when field iteration order changed.

Refactored doTest() to use regex-based YAML parsing that extracts field-value
pairs into a HashMap for order-independent validation. This approach validates
the same semantics while being resilient to field ordering variations.
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