jackrabbit-oak
jackrabbit-oak copied to clipboard
OAK-10556: Fix two order-dependent flaky tests by resetting hit count
fix two order-dependent tests by resetting hit count.
Related test: org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexProviderTest.singleQueryRun org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexProviderTest.multipleQueryRuns
These two tests modify the hit count of OrderedPropertyIndexProvider
without resetting it after the test, but the assertion in the test multipleQueryRuns relies on this hit count. The test multipleQueryRuns implicitly assumes singleQueryRun has already run before, which makes the test order-dependent.
Describe how you did it
The fix introduces a method resetHits()
to reset the hit count before each test starts.