Author: jbellis
Date: Fri Sep 23 01:01:23 2011
New Revision: 1174472

URL: http://svn.apache.org/viewvc?rev=1174472&view=rev
Log:
wait a few seconds for index to get flagged as built on startup to avoid false 
negatives

Modified:
    
cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/db/CleanupTest.java

Modified: 
cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/db/CleanupTest.java
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/db/CleanupTest.java?rev=1174472&r1=1174471&r2=1174472&view=diff
==============================================================================
--- 
cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/db/CleanupTest.java
 (original)
+++ 
cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/db/CleanupTest.java
 Fri Sep 23 01:01:23 2011
@@ -109,7 +109,9 @@ public class CleanupTest extends Cleanup
         assertEquals(LOOPS, rows.size());
 
         SecondaryIndex index = cfs.indexManager.getIndexForColumn(COLUMN);
-        assertTrue(index.isIndexBuilt(COLUMN));
+        long start = System.currentTimeMillis();
+        while (!index.isIndexBuilt(COLUMN) && System.currentTimeMillis() < 
start + 10000)
+            Thread.sleep(10);
 
         // verify we get it back w/ index query too
         IndexExpression expr = new IndexExpression(COLUMN, IndexOperator.EQ, 
VALUE);


Reply via email to