zacharymorn commented on a change in pull request #1998: URL: https://github.com/apache/lucene-solr/pull/1998#discussion_r509958005
########## File path: lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java ########## @@ -163,6 +163,17 @@ public void testExitableFilterTermsIndexReader() throws Exception { searcher.search(query, 10); reader.close(); + // Set a fairly high timeout value (infinite) and expect the query to complete in that time frame. + // Not checking the validity of the result, but checking the sampling kicks in to reduce the number of timeout check + CountingQueryTimeout queryTimeout = new CountingQueryTimeout(); + directoryReader = DirectoryReader.open(directory); + exitableDirectoryReader = new ExitableDirectoryReader(directoryReader, queryTimeout); + reader = new TestReader(getOnlyLeafReader(exitableDirectoryReader)); + searcher = new IndexSearcher(reader); + searcher.search(query, 10); + reader.close(); + assertEquals(3, queryTimeout.getShouldExitCallCount()); Review comment: Sounds good. I've added another commit to separate out the test, and adjusted assertion and added comments. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org