[
https://issues.apache.org/jira/browse/LUCENE-10316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17459420#comment-17459420
]
Haoyu Zhai commented on LUCENE-10316:
-------------------------------------
So basically the test is about making sure the query cache has the right
estimation when the query has implemented the {{Accountable}} interface.
When I originally wrote it I estimated the query cache size using {{(query_size
+ linked_hash_map_entry_size) * query_num}} with 10% slack to allow the error
of estimation. But apparently it is not enough sometimes (probably larger
number of cache entries will waste more?).
Given the aim of the test is make sure when there're known big queries being
cached the query cache reflect it correctly, I think we could change that to
{{assert(query_cache_size > sum_of_all_queries_cached)}}. Then we won't depend
on a slack to assert the correctness.
> fix TestLRUQueryCache.testCachingAccountableQuery failure
> ---------------------------------------------------------
>
> Key: LUCENE-10316
> URL: https://issues.apache.org/jira/browse/LUCENE-10316
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/search
> Reporter: Haoyu Zhai
> Priority: Minor
>
> I saw this build failure:
> https://jenkins.thetaphi.de/job/Lucene-9.x-Linux/348/
> with following stack trace
> {code:java}
> java.lang.AssertionError: expected:<1388880.0> but was:<1544976.0>
> at
> __randomizedtesting.SeedInfo.seed([F7826B1EB37D545A:995B6ED46A95D1A0]:0)
> at org.junit.Assert.fail(Assert.java:89)
> at org.junit.Assert.failNotEquals(Assert.java:835)
> at org.junit.Assert.assertEquals(Assert.java:577)
> at org.junit.Assert.assertEquals(Assert.java:701)
> at
> org.apache.lucene.search.TestLRUQueryCache.testCachingAccountableQuery(TestLRUQueryCache.java:570)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1754)
> at
> com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:942)
> at
> com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:978)
> at
> com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:992)
> ...
> {code}
> It does not reproduce on my laptop on current main branch, but since the test
> is comparing an estimation with a 10% slack, it can fail for sure sometime.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]