You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/03/08 18:32:46 UTC

[GitHub] [lucene-solr] dnhatn commented on a change in pull request #1331: LUCENE-9268: Add some random tests to IndexWriter

dnhatn commented on a change in pull request #1331: LUCENE-9268: Add some random tests to IndexWriter
URL: https://github.com/apache/lucene-solr/pull/1331#discussion_r389393993
 
 

 ##########
 File path: lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
 ##########
 @@ -3775,4 +3777,120 @@ public void testRefreshAndRollbackConcurrently() throws Exception {
       IOUtils.close(sm, dir);
     }
   }
+
+  public void testRandomOperations() throws Exception {
+    IndexWriterConfig iwc = newIndexWriterConfig();
+    iwc.setMergePolicy(new FilterMergePolicy(newMergePolicy()) {
+      boolean keepFullyDeletedSegment = random().nextBoolean();
+
+      @Override
+      public boolean keepFullyDeletedSegment(IOSupplier<CodecReader> readerIOSupplier) {
+        return keepFullyDeletedSegment;
+      }
+    });
+    try (Directory dir = newDirectory();
+         IndexWriter writer = new IndexWriter(dir, iwc);
+         SearcherManager sm = new SearcherManager(writer, new SearcherFactory())) {
+      Semaphore permits = new Semaphore(10 + random().nextInt(1000));
 
 Review comment:
   ++. Adjusted in https://github.com/apache/lucene-solr/pull/1331/commits/e3fd5ce0643d7a05fd0b530b20b58e7b5589cd2a.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org