usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [04/50] usergrid git commit: Add delay to stale index cleanup on deletes.
Date Tue, 08 Sep 2015 21:06:07 GMT
Add delay to stale index cleanup on deletes.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/982bfd90
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/982bfd90
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/982bfd90

Branch: refs/heads/usergrid-103-upgrade-jersey
Commit: 982bfd9075c6ae2eb6f6a22dea1aa1ea152e4b9e
Parents: 912c78e
Author: Michael Russo <michaelarusso@gmail.com>
Authored: Fri Aug 28 13:48:57 2015 -0700
Committer: Michael Russo <michaelarusso@gmail.com>
Committed: Fri Aug 28 13:48:57 2015 -0700

----------------------------------------------------------------------
 .../corepersistence/StaleIndexCleanupTest.java         | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/982bfd90/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 58406b4..832409b 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -363,28 +363,29 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
 
         // query Core Persistence directly for total number of result candidates
         crs = queryCollectionCp("things", "thing", "select *");
-        Assert.assertEquals( "Expect stale candidates", numEntities * (numUpdates + 1), crs.size());
+        Assert.assertEquals("Expect stale candidates", numEntities * (numUpdates + 1), crs.size());
 
         // turn ON post processing stuff that cleans up stale entities
-        System.setProperty( EVENTS_DISABLED, "false" );
+        System.setProperty(EVENTS_DISABLED, "false");
 
         // delete all entities
         for ( Entity thing : things ) {
             em.delete( thing );
         }
 
+        Thread.sleep(250); // delete happens asynchronously, wait for some time
 
-        //put this into the top of the queue, once it's acked we've been flushed
+        //refresh the app index
         app.refreshIndex();
 
-        // wait for indexes to be cleared for the deleted entities
-        count = 0;
-
+        Thread.sleep(250); // refresh happens asynchronously, wait for some time
+        
 
         //we can't use our candidate result sets here.  The repair won't happen since we
now have orphaned documents in our index
         //us the EM so the repair process happens
 
         Results results = null;
+        count = 0;
         do {
             //trigger the repair
             results = queryCollectionEm("things", "select *");


Mime
View raw message