aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrwin Dunietz <id1681@att.com>2018-04-03 18:18:58 -0400
committerTakamune Cho <tc012c@att.com>2018-04-03 23:55:54 +0000
commit68c95691b62a334e4d98ca32c6fbd1046e3270a6 (patch)
tree71b34bfa37243eaca9422b43fa66defb5546881c
parenta186e7f1e83164e5f2d5a310efce5db7340498a8 (diff)
Fix junit-test robustness for RequestContext class
Alter a junit test for a RequestContext class to succeed more reliably Change-Id: I93f3ffdb846aca1daaa690e4c6b4a822c514a88b Issue-ID: APPC-826 Signed-off-by: Irwin Dunietz <id1681@att.com>
-rw-r--r--appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/test/java/org/onap/appc/adapter/restHealthcheck/impl/RequestContextTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/test/java/org/onap/appc/adapter/restHealthcheck/impl/RequestContextTest.java b/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/test/java/org/onap/appc/adapter/restHealthcheck/impl/RequestContextTest.java
index 0b41c861d..1e442b0c1 100644
--- a/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/test/java/org/onap/appc/adapter/restHealthcheck/impl/RequestContextTest.java
+++ b/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/test/java/org/onap/appc/adapter/restHealthcheck/impl/RequestContextTest.java
@@ -161,6 +161,12 @@ public class RequestContextTest {
assertTrue(rc.getTotalDuration() >= 2 * delay);
rc.reset();
rc.delay();
+ // Ensure exceeded timeToLive
+ try {
+ Thread.sleep(1L);
+ } catch (Throwable e) {
+ // Even if interrupted, assume enough delay has occurred
+ }
assertFalse(rc.isAlive());
assertTrue(rc.getTotalDuration() >= 3 * delay);
}