zacharymorn commented on a change in pull request #2052:
URL: https://github.com/apache/lucene-solr/pull/2052#discussion_r528054089



##########
File path: 
lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
##########
@@ -745,7 +745,7 @@ public synchronized IndexInput openInput(String name, 
IOContext context) throws
       maybeThrowDeterministicException();
     }
     if (!LuceneTestCase.slowFileExists(in, name)) {
-      throw randomState.nextBoolean() ? new FileNotFoundException(name + " in 
dir=" + in) : new NoSuchFileException(name + " in dir=" + in);
+      throw new NoSuchFileException(name + " in dir=" + in);

Review comment:
       Ops sorry this was work-in-progress and got accidentally pushed (I got 
too excited from all the tests passed after changing to 
`LuceneTestCase.newFSDirectory(path)` in test) . 
   
   The reason for the change here is that in 
`BaseDirectoryTestCase.testPendingDeletions`, it specifically tests for 
`NoSuchFileException` , so I initially removed it to confirm that's the code 
failing the test:
   
   
https://github.com/apache/lucene-solr/blob/fddb5314fcccf5b3a416362b94a454599b43af84/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java#L1197-L1199
   
   I've reverted this change, and update the test method to check for either 
exception.
   
   > This randomness was (is?) useful to help test 
   
   I did run `./gradlew check` with the randomness removed a few times, and the 
tests passed, so either the randomness did not kick in, or the other exception 
wasn't actually used in code under test.
   
   




----------------------------------------------------------------
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

Reply via email to