Fix junit-test robustness for RequestContext class
[appc.git] / appc-adapters / appc-rest-healthcheck-adapter / appc-rest-healthcheck-adapter-bundle / src / test / java / org / onap / appc / adapter / restHealthcheck / impl / RequestContextTest.java
index 0b41c86..1e442b0 100644 (file)
@@ -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);
     }