Skip to content

Flaky tests detected: ConsumerJsonRecordTest.should_serialize_a_record_with_headers #685

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
hermya opened this issue Oct 6, 2024 · 1 comment
Assignees

Comments

@hermya
Copy link
Contributor

hermya commented Oct 6, 2024

The Problem:

There are some flaky-tests in the repo, which assert the output of non-deterministic outputs. They may pass in specific environment but possible fail in others. By using nondex, one can find such cases.

For example: ConsumerJsonRecordTest.should_serialize_a_record_with_headers fails intermittently

Expected: "{\"key\":123,\"value\":\"val\",\"headers\":{\"hKey\":\"hValue\",\"hKeyWithNullValue\":null}}"
     but: was "{\"key\":123,\"value\":\"val\",\"headers\":{\"hKeyWithNullValue\":null,\"hKey\":\"hValue\"}}"

Notice the string mismatch due to change in ordering of keys: {hKey, hKeyWithNullValue} <=> {hKeyWithNullValue, hKey}

About The Fix:

Answered here.

@nirmalchandra
Copy link
Collaborator

PR merge. Changes were only to Test classes, so no impact to the release versions.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants