rearrange asserts in DroolsRunnable tests 14/118314/1
authorjhh <jorge.hernandez-herrero@att.com>
Tue, 23 Feb 2021 19:32:38 +0000 (13:32 -0600)
committerjhh <jorge.hernandez-herrero@att.com>
Tue, 23 Feb 2021 19:32:38 +0000 (13:32 -0600)
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 <jorge.hernandez-herrero@att.com>
Change-Id: I0f2df770dfdda6d23e9cb29253f4152a0365d33a

policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java

index 939de08..9fe5c70 100644 (file)
@@ -188,9 +188,9 @@ public class DroolsContainerTest {
 
             final LinkedBlockingQueue<String> 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 {