From: jhh Date: Tue, 23 Feb 2021 19:32:38 +0000 (-0600) Subject: rearrange asserts in DroolsRunnable tests X-Git-Tag: 1.8.0~2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=4a3bb35cf14f9eff17b2e2bc5f09514d298a0c35;p=policy%2Fdrools-pdp.git rearrange asserts in DroolsRunnable tests There are consistent failures when doing staging builds in policy-core junits. This problem shows only in stage builds. It is suspected to be a race conditioning with the internal scheduling of rules and insertion of events. Issue-ID: POLICY-3097 Signed-off-by: jhh Change-Id: I0f2df770dfdda6d23e9cb29253f4152a0365d33a --- diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java b/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java index 939de08c..9fe5c708 100644 --- a/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java +++ b/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java @@ -188,9 +188,9 @@ public class DroolsContainerTest { final LinkedBlockingQueue lbq = new LinkedBlockingQueue<>(); executor.execute(() -> lbq.add("DroolsRunnable String")); - executor.execute(() -> lbq.add("another DroolsRunnable String")); - assertEquals("DroolsRunnable String", lbq.poll(TIMEOUT_SEC, TimeUnit.SECONDS)); + + executor.execute(() -> lbq.add("another DroolsRunnable String")); assertEquals("another DroolsRunnable String", lbq.poll(TIMEOUT_SEC, TimeUnit.SECONDS)); } finally {