Skip to content

Commit

Permalink
Merge pull request #1496 from mohanvive/master
Browse files Browse the repository at this point in the history
Reduce the probability of test failure
  • Loading branch information
mohanvive authored Sep 10, 2019
2 parents 9fc0a76 + ac0c1cd commit 64bab01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1937,9 +1937,9 @@ public void testQueryAbsent47() throws InterruptedException {
InputHandler stream3 = siddhiAppRuntime.getInputHandler("Stream3");
siddhiAppRuntime.start();

Thread.sleep(2200);
Thread.sleep(2100);
stream3.send(new Object[]{"WSO2", 35.0f, 100});
Thread.sleep(2200);
Thread.sleep(2100);
stream3.send(new Object[]{"IBM", 55.0f, 100});
Thread.sleep(1000);

Expand All @@ -1954,7 +1954,7 @@ public void testQueryAbsent47() throws InterruptedException {

@Test(dependsOnMethods = {"testQueryAbsent47"})
public void testQueryAbsent48() throws InterruptedException {
log.info("Test the query every (not e1 for 1 sec or not e2 for 1 sec) -> e3 with only e3 after 2 seconds");
log.info("Test the query every (not e1 for 2 sec or not e2 for 2 sec) -> e3 with only e3 after 4 seconds");

SiddhiManager siddhiManager = new SiddhiManager();

Expand All @@ -1964,7 +1964,7 @@ public void testQueryAbsent48() throws InterruptedException {
"define stream Stream3 (symbol string, price float, volume int); ";
String query = "" +
"@info(name = 'query1') " +
"from every (not Stream1[price>10] for 1 sec or not Stream2[price>20] for 1 sec) -> " +
"from every (not Stream1[price>10] for 2 sec or not Stream2[price>20] for 2 sec) -> " +
"e3=Stream3[price>30] " +
"select e3.symbol as symbol " +
"insert into OutputStream ;";
Expand All @@ -1977,7 +1977,7 @@ public void testQueryAbsent48() throws InterruptedException {
InputHandler stream3 = siddhiAppRuntime.getInputHandler("Stream3");
siddhiAppRuntime.start();

Thread.sleep(2100);
Thread.sleep(4100);
stream3.send(new Object[]{"WSO2", 35.0f, 100});
Thread.sleep(1000);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 64bab01

Please sign in to comment.