https://www.apache.org/foundation/mailinglists
On Tue, Jan 20, 2026 at 5:38 AM Heitor Peralles <[email protected]> wrote: > > How can I stop receiving these emails? > > Heitor G. Peralles > Direct: +55 21 979 661 187 > Email: [email protected] > LinkedIn: linkedin.com/in/heitorperalles > > > On Tue, Jan 20, 2026, 07:33 <[email protected]> wrote: >> >> This is an automated email from the ASF dual-hosted git repository. >> >> romseygeek pushed a commit to branch main >> in repository https://gitbox.apache.org/repos/asf/lucene.git >> >> >> The following commit(s) were added to refs/heads/main by this push: >> new c440fb7ead6 Monitor: Make TestCachePurging more failsafe (#15589) >> c440fb7ead6 is described below >> >> commit c440fb7ead6c6e39b26f47115077ff306e975dc1 >> Author: Alexander Reelsen <[email protected]> >> AuthorDate: Tue Jan 20 11:33:48 2026 +0100 >> >> Monitor: Make TestCachePurging more failsafe (#15589) >> >> Add a new test for testing stats instead of hoping the assertion works >> in the >> cache purging tests. >> >> Closes #15587 >> --- >> .../apache/lucene/monitor/TestCachePurging.java | 2 -- >> .../org/apache/lucene/monitor/TestMonitor.java | 22 >> ++++++++++++++++++++++ >> 2 files changed, 22 insertions(+), 2 deletions(-) >> >> diff --git >> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java >> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java >> index e681d173b07..eeecd613ad9 100644 >> --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java >> +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java >> @@ -137,8 +137,6 @@ public class TestCachePurging extends MonitorTestBase { >> new MonitorConfiguration().setPurgeFrequency(50, >> TimeUnit.MILLISECONDS); >> try (Monitor monitor = new Monitor(ANALYZER, Presearcher.NO_FILTERING, >> config)) { >> >> - assertEquals(-1, monitor.getQueryCacheStats().lastPurged()); >> - >> for (int i = 0; i < 100; i++) { >> monitor.register(newMonitorQuery(i)); >> } >> diff --git >> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java >> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java >> index cd75596dd4a..f4d990a5cb1 100644 >> --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java >> +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java >> @@ -253,4 +253,26 @@ public class TestMonitor extends MonitorTestBase { >> assertEquals(0, matches.getMatchCount()); >> } >> } >> + >> + public void testQueryCacheStats() throws IOException { >> + try (Monitor monitor = newMonitor()) { >> + assertEquals(-1, monitor.getQueryCacheStats().lastPurged()); >> + assertEquals(0, monitor.getQueryCacheStats().queries()); >> + assertEquals(0, monitor.getQueryCacheStats().cachedQueries()); >> + >> + MonitorQuery[] queries = >> + new MonitorQuery[] { >> + new MonitorQuery("1", parse("test1")), >> + new MonitorQuery("2", parse("test2")), >> + new MonitorQuery("3", parse("test3")) >> + }; >> + monitor.register(queries); >> + assertEquals(3, monitor.getQueryCacheStats().queries()); >> + assertEquals(3, monitor.getQueryCacheStats().cachedQueries()); >> + >> + assertEquals(-1, monitor.getQueryCacheStats().lastPurged()); >> + monitor.purgeCache(); >> + assertTrue(monitor.getQueryCacheStats().lastPurged() > 0); >> + } >> + } >> } >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
