dweiss commented on a change in pull request #1779:
URL: https://github.com/apache/lucene-solr/pull/1779#discussion_r475755023



##########
File path: 
lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java
##########
@@ -36,6 +37,26 @@
  */
 public class TestDocumentsWriterDeleteQueue extends LuceneTestCase {
 
+
+  public void testAdvanceReferencesOriginal() {
+    WeakAndNext weakAndNext = new WeakAndNext();
+    DocumentsWriterDeleteQueue next = weakAndNext.next;
+    assertNotNull(next);
+    System.gc();

Review comment:
       I checked openjdk sources and they use System.gc() with a similar 
expectation that it will always try to flush all weak refs before returning, so 
this seems fine. The test itself could maybe be made more explicit by utilizing 
an explicit ReferenceQueue rather than asserting the reference has been cleared 
but this is a matter of taste - if this works, it will in both cases.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to