You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/05/25 22:27:35 UTC
[13/34] incubator-geode git commit: GEODE-1367: Added Awaitility to
wait for threads to shut down.
GEODE-1367: Added Awaitility to wait for threads to shut down.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/61227233
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/61227233
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/61227233
Branch: refs/heads/feature/GEODE-835
Commit: 61227233dc7d07174331f8fb1c6b7488a1e91f9c
Parents: 6534611
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Wed May 18 07:52:59 2016 +1000
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Tue May 24 03:37:40 2016 +1000
----------------------------------------------------------------------
.../LocatorLauncherAssemblyIntegrationTest.java | 21 ++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/61227233/geode-assembly/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherAssemblyIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherAssemblyIntegrationTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherAssemblyIntegrationTest.java
index 84d4aba..81f345d 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherAssemblyIntegrationTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherAssemblyIntegrationTest.java
@@ -27,7 +27,6 @@ import com.gemstone.gemfire.internal.process.ProcessUtils;
import com.gemstone.gemfire.management.ManagementService;
import com.gemstone.gemfire.management.ManagerMXBean;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import com.gemstone.gemfire.test.junit.runners.CategoryWithParameterizedRunnerFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -143,17 +142,19 @@ public class LocatorLauncherAssemblyIntegrationTest extends AbstractLocatorLaunc
this.errorCollector.addError(e);
}
- int finalThreadCount = Integer.MAX_VALUE;
+ Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS).pollDelay(100, TimeUnit.MILLISECONDS)
+ .timeout(60, TimeUnit.SECONDS).until(() -> initialThreadCount == Thread.activeCount());
// Spin for up to 5 seconds waiting for threads to finish
- for (int i = 0; i < 50 && finalThreadCount > initialThreadCount; i++) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- // ignored
- }
- finalThreadCount = Thread.activeCount();
- }
+ // for (int i = 0; i < 50 && finalThreadCount > initialThreadCount; i++) {
+ // try {
+ // Thread.sleep(100);
+ // } catch (InterruptedException ex) {
+ // ignored
+ // }
+ // finalThreadCount = Thread.activeCount();
+ // }
+ int finalThreadCount = Thread.activeCount();
assertEquals(initialThreadCount, finalThreadCount);
}