Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
fix two order-dependent tests by resetting hit count.
Related test:
[org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexProviderTest.singleQueryRun](https://github.com/lxb007981/jackrabbit-oak/blob/0440e096dc7a460d206c77a5f178796db31a0ef4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndexProviderTest.java#L58)
[org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexProviderTest.multipleQueryRuns](https://github.com/lxb007981/jackrabbit-oak/blob/0440e096dc7a460d206c77a5f178796db31a0ef4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndexProviderTest.java#L68)
These two tests modify the [hit count](https://github.com/lxb007981/jackrabbit-oak/blob/0440e096dc7a460d206c77a5f178796db31a0ef4/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndexProvider.java#L37) of `OrderedPropertyIndexProvider` without resetting it after the test, but the assertion in the test [multipleQueryRuns](https://github.com/lxb007981/jackrabbit-oak/blob/0440e096dc7a460d206c77a5f178796db31a0ef4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndexProviderTest.java#L68) relies on this hit count. The test [multipleQueryRuns](https://github.com/lxb007981/jackrabbit-oak/blob/0440e096dc7a460d206c77a5f178796db31a0ef4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndexProviderTest.java#L68) implicitly assumes [singleQueryRun](https://github.com/lxb007981/jackrabbit-oak/blob/0440e096dc7a460d206c77a5f178796db31a0ef4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndexProviderTest.java#L58) has already run before, which makes the test order-dependent.
The fix introduces a method `resetHits()` to reset the hit count before each test starts.
Attachments
Issue Links
- links to