jackrabbit-oak icon indicating copy to clipboard operation
jackrabbit-oak copied to clipboard

OAK-10556: Fix two order-dependent flaky tests by resetting hit count

Open lxb007981 opened this issue 1 year ago • 0 comments

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.

lxb007981 avatar Nov 18 '23 23:11 lxb007981