-
-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed flaky test-case: ConsumerJsonRecordTest.should_serialize_a_record_with_headers #684
Conversation
ConsumerJsonRecordTest.should_serialize_a_record_with_headers POINT OF FAILURE -> random attribute ordering in hashmap Fixed using NonDex, plugin added in parent pom. Suggested command to check flaky tests : > mvn nondex:nondex For particular test: >mvn -pl ./core nondex:nondex -Dtest=org.jsmart.zerocode.core.kafka.receive.message.ConsumerJsonRecordTest#should_serialize_a_record_with_headers -DnondexRuns=10 For more information : https://github.com/TestingResearchIllinois/NonDex
…o modify pull request message about the pom.xml change
Fixed flaky test-case: ConsumerJsonRecordTest.should_serialize_a_record_with_headers
@hermya , appreciate the fix. Can you create a Issue(short, one or two lines in fine) and link to this ticket please? We'll have a look soon |
@nirmalchandra, thank you! Created an issue and updated it in the above comment as well. |
Thank you @hermya , can you please put couple of line about the fix (how the test was fixed) ? In the mean time I will get the CI triggered(as soon as we see the details I mean). Also, just checking, you have updated to "LinkedhashMap" in the test, which looks fine. But was the maven dependency which you added&removed from the POM file, was pushed by mistake ? |
You're welcome @nirmalchandra ! 1. Can you please put couple of line about the fix (how the test was fixed)?In HashMap implementation of Map, there's no guarantee of key ordering. LinkedHashMap keeps the order of insertion and it's toString() or keySet() will also maintain that order, ensuring deterministic representation. 2. Please explain how it was never failed during the CI build earlier:It might have never failed because the hash-key ordering is dependent on the current state of underlying jvm. It is possible that it fails on a different environment 3. Is it failing in your local laptop (sometimes?) ?It fails with the nondex. Nondex is a useful tool for such situations, where outputs of non-deterministic states are compared. 4. But was the maven dependency which you added&removed from the POM file, was pushed by mistake?I added it earlier, thinking that it'd be a good idea for your experimentation. However, you can run nondex without it using slightly modified command mentioned in main comment, so I removed it for cleanliness. |
Fixed flaky test-case
Fixes Issue
Flaky tests detected: ConsumerJsonRecordTest.should_serialize_a_record_with_headers #685
PR Branch
fork
Motivation and Context
ConsumerJsonRecordTest.should_serialize_a_record_with_headers is a flaky test, fixed in this PR.
POINT OF FAILURE -> random attribute ordering in hashmap
Fixed using NonDex pugin
Suggested command to check all flaky tests :
For particular test:
Add the following lines to your pom.xml
and run
OR
For more information : https://github.com/TestingResearchIllinois/NonDex
Checklist:
New Unit tests were added
Integration tests were added
Test names are meaningful
Feature manually tested and outcome is successful
PR doesn't break any of the earlier features for end users
Branch build passed in CI
No 'package.*' in the imports
Relevant DOcumentation page added or updated with clear instructions and examples for the end user
Http test added to
http-testing
module(if applicable) ?Kafka test added to
kafka-testing
module(if applicable) ?