You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/10/18 20:09:31 UTC

[GitHub] [bookkeeper] aditya-kumbhar opened a new pull request, #3551: Issue 3550: Fix flaky tests in AuditorReplicasCheckTest

aditya-kumbhar opened a new pull request, #3551:
URL: https://github.com/apache/bookkeeper/pull/3551

   ### Motivation
   
   AuditorReplicasCheckTest has the following tests that are flaky, detected using the [NonDex](https://github.com/TestingResearchIllinois/NonDex) tool.
   testReplicasCheckForLedgersFoundHavingLessThanAQReplicasOfAnEntry()
   testReplicasCheckForLedgersFoundHavingLessThanWQReplicasOfAnEntry()
   testReplicasCheckForLedgersFoundHavingNoReplica()
   testReplicasCheckForLedgersWithEmptySegments()
   
   The tests fail due to non-deterministic ordering in the HashMap `segmentEnsembles`
   The following check fails in the `newEnsembleEntry()` method since it assumes the ordering of `segmentEnsembles` to be deterministic:
   ```
   checkArgument(ensembles.isEmpty() || firstEntry > ensembles.lastKey(),
                         "New entry must have a first entry greater than any existing ensemble key");
   ```
   
   Command to reproduce:
   ```
   mvn -pl bookkeeper-server edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=org.apache.bookkeeper.replication.AuditorReplicasCheckTest
   ```
   
   ### Changes
   
   Changed the datatype of `segmentEnsembles` from HashMap to [LinkedHashMap](https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html) as it has a deterministic iteration order, while [HashMap](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html) does not guarantee the order of its elements.
   The tests pass with NonDex after making this change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [bookkeeper] hangc0276 merged pull request #3551: Issue 3550: Fix flaky tests in AuditorReplicasCheckTest

Posted by GitBox <gi...@apache.org>.
hangc0276 merged PR #3551:
URL: https://github.com/apache/bookkeeper/pull/3551


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org