From a24d854470caf2dcbdc3e41b168224e3212d13e5 Mon Sep 17 00:00:00 2001 From: Mohan Date: Tue, 10 Sep 2019 14:43:29 +0530 Subject: [PATCH] Reduce the probability of test failure --- .../java/io/siddhi/core/query/window/CronWindowTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/siddhi-core/src/test/java/io/siddhi/core/query/window/CronWindowTestCase.java b/modules/siddhi-core/src/test/java/io/siddhi/core/query/window/CronWindowTestCase.java index 455723c342..2c054e9093 100644 --- a/modules/siddhi-core/src/test/java/io/siddhi/core/query/window/CronWindowTestCase.java +++ b/modules/siddhi-core/src/test/java/io/siddhi/core/query/window/CronWindowTestCase.java @@ -23,6 +23,7 @@ import io.siddhi.core.stream.input.InputHandler; import io.siddhi.core.stream.output.StreamCallback; import io.siddhi.core.util.EventPrinter; +import io.siddhi.core.util.SiddhiTestHelper; import org.apache.log4j.Logger; import org.testng.AssertJUnit; import org.testng.annotations.BeforeMethod; @@ -126,7 +127,7 @@ public void receive(Event[] events) { Thread.sleep(7000); inputHandler.send(new Object[]{"IBM43", 700f, 0}); inputHandler.send(new Object[]{"WSO4343", 60.5f, 1}); - Thread.sleep(7000); + SiddhiTestHelper.waitForEvents(7000, 4, removeEventCount, 20000); AssertJUnit.assertEquals(4, removeEventCount); AssertJUnit.assertTrue(eventArrived); siddhiAppRuntime.shutdown();