You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2014/12/15 19:31:59 UTC
[15/50] incubator-usergrid git commit: test fixes
test fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a3cfd56b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a3cfd56b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a3cfd56b
Branch: refs/heads/two-dot-o
Commit: a3cfd56b6d4a0e5043549a6c64b7067554a2167b
Parents: 4a36aa1
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Oct 31 15:55:19 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Oct 31 15:55:19 2014 -0400
----------------------------------------------------------------------
.../usergrid/corepersistence/StaleIndexCleanupTest.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a3cfd56b/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 ff740af..3dd63c0 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
@@ -208,7 +208,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
* Test that the EntityDeleteImpl cleans up stale indexes on delete. Ensures that when an
* entity is deleted its old indexes are cleared from ElasticSearch.
*/
- @Test
+ @Test(timeout=10000)
public void testCleanupOnDelete() throws Exception {
logger.info("Started testStaleIndexCleanup()");
@@ -274,7 +274,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
do {
Thread.sleep(100);
crs = queryCollectionCp("things", "select *");
- } while ( crs.size() > 0 || count++ < 14 );
+ } while ( crs.size() > 0 && count++ < 14 );
Assert.assertEquals( "Expect no candidates", 0, crs.size() );
}
@@ -284,7 +284,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
* Test that the EntityDeleteImpl cleans up stale indexes on update. Ensures that when an
* entity is updated its old indexes are cleared from ElasticSearch.
*/
- @Test
+ @Test(timeout=10000)
public void testCleanupOnUpdate() throws Exception {
logger.info("Started testCleanupOnUpdate()");
@@ -340,12 +340,12 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
Assert.assertEquals( "Expect stale candidates", numEntities * (numUpdates + 1), crs.size());
// wait for indexes to be cleared for the deleted entities
- count = 0;
do {
Thread.sleep(100);
crs = queryCollectionCp("things", "select *");
- } while ( crs.size() > 0 || count++ < 14 );
+ } while ( crs.size() > 0 );
+ // will never get here if test times out
Assert.assertEquals( "Expect no candidates", 0, crs.size() );
}