Skip to content

Commit

Permalink
[incubator-kie-drools-6093] flaky test: org.drools.compiler.integrati…
Browse files Browse the repository at this point in the history
…ontests.TimerAndCalendarFireUntilHaltTest (apache#6096)
  • Loading branch information
tkobayas authored and rgdoliveira committed Oct 3, 2024
1 parent 08a5a4b commit ed3c4a1
Showing 1 changed file with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ public void testTimerRuleFires() throws Exception {
startEngine();

activateRule();
advanceTimerOneSecond();

await().until(ruleHasFired("TimerRule", 1));

advanceTimerOneSecond();
await().until(ruleHasFired("TimerRule", 2));

stopEngine();
}

@Test(timeout = 10000)
Expand All @@ -126,14 +129,17 @@ public void testTimerRuleHaltStopsFiring() throws Exception {
"end";
setupKSessionFor(drl);
startEngine();

activateRule();
advanceTimerOneSecond();
await().until(ruleHasFired("TimerRule", 1));

advanceTimerOneSecond();
await().until(ruleHasFired("TimerRule", 2));

stopEngine();

advanceTimerOneSecond();
await().during(Duration.ofSeconds(1)).atMost(Duration.ofSeconds(2)).until(ruleHasFired("TimerRule", 1));
await().during(Duration.ofSeconds(1)).atMost(Duration.ofSeconds(2)).until(ruleHasFired("TimerRule", 2));
}

@Test(timeout = 10000)
Expand All @@ -148,15 +154,20 @@ public void testTimerRuleRestartsAfterStop() throws Exception {
"end";
setupKSessionFor(drl);
startEngine();

activateRule();
advanceTimerOneSecond();
await().until(ruleHasFired("TimerRule", 1));

advanceTimerOneSecond();
await().until(ruleHasFired("TimerRule", 2));

stopEngine();
startEngine();

advanceTimerOneSecond();
await().during(Duration.ofSeconds(1)).atMost(Duration.ofSeconds(2)).until(ruleHasFired("TimerRule", 2));
await().during(Duration.ofSeconds(1)).atMost(Duration.ofSeconds(2)).until(ruleHasFired("TimerRule", 3));

stopEngine();
}

@Test(timeout = 10000)
Expand All @@ -171,18 +182,21 @@ public void testTimerRuleDoesRestartsIfNoLongerHolds() throws Exception {
"end";
setupKSessionFor(drl);
startEngine();

activateRule();
advanceTimerOneSecond();

await().until(ruleHasFired("TimerRule", 1));

advanceTimerOneSecond();
await().until(ruleHasFired("TimerRule", 2));

stopEngine();
disactivateRule();
startEngine();

advanceTimerOneSecond();
await().during(Duration.ofSeconds(1)).atMost(Duration.ofSeconds(2)).until(ruleHasFired("TimerRule", 2));

await().during(Duration.ofSeconds(1)).atMost(Duration.ofSeconds(2)).until(ruleHasFired("TimerRule", 1));
stopEngine();
}


Expand Down

0 comments on commit ed3c4a1

Please sign in to comment.