lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r906441 - /lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
Date Thu, 04 Feb 2010 10:23:42 GMT
Author: simonw
Date: Thu Feb  4 10:23:42 2010
New Revision: 906441

URL: http://svn.apache.org/viewvc?rev=906441&view=rev
Log:
updated test after clover instrumentation run failure. Thread termination timeout set to 60
seconds and made booleans in workers volatile.

Modified:
    lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java

Modified: lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java?rev=906441&r1=906440&r2=906441&view=diff
==============================================================================
--- lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
(original)
+++ lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
Thu Feb  4 10:23:42 2010
@@ -299,12 +299,12 @@
     
     spellChecker.close();
     executor.shutdown();
-    executor.awaitTermination(5, TimeUnit.SECONDS);
-    
+    // wait for 60 seconds - usually this is very fast but coverage runs could take quite
long
+    executor.awaitTermination(60L, TimeUnit.SECONDS);
     
     for (int i = 0; i < workers.length; i++) {
-      assertFalse(workers[i].failed);
-      assertTrue(workers[i].terminated);
+      assertFalse(String.format("worker thread %d failed", i), workers[i].failed);
+      assertTrue(String.format("worker thread %d is still running but should be terminated",
i), workers[i].terminated);
     }
     // 4 searchers more than iterations
     // 1. at creation
@@ -347,8 +347,8 @@
   
   private class SpellCheckWorker implements Runnable {
     private final IndexReader reader;
-    boolean terminated = false;
-    boolean failed = false;
+    volatile boolean terminated = false;
+    volatile boolean failed = false;
     
     SpellCheckWorker(IndexReader reader) {
       super();



Mime
View raw message