You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "lxb007981 (via GitHub)" <gi...@apache.org> on 2023/11/18 23:04:40 UTC

[PR] OAK-10556: Fix two order-dependent flaky tests by resetting hit count [jackrabbit-oak]

lxb007981 opened a new pull request, #1220:
URL: https://github.com/apache/jackrabbit-oak/pull/1220

   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/jackrabbi
 t/oak/plugins/index/property/OrderedPropertyIndexProviderTest.java#L58) 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.


-- 
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: dev-unsubscribe@jackrabbit.apache.org

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