Skip to content

Commit

Permalink
Fix flaky ShellTimerTest
Browse files Browse the repository at this point in the history
The nested timer test was depending on how long it took for the tests to run,
which is never a good thing for a timer-related test.
  • Loading branch information
gbrail authored and rbri committed Oct 4, 2024
1 parent 3d7b17b commit 5b9ba19
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,14 @@ public void nestedTimers() throws InterruptedException {
runTest(
"load('testsrc/assert.js');\n"
+ "let count = 0;\n"
+ "setTimeout(() => { assertEquals(0, count++);\n"
+ " setTimeout(() => { assertEquals(2, count++); TestsComplete = true; }, 5);\n"
+ " setTimeout(() => { assertEquals(1, count++); }, 2);\n"
+ "setTimeout(() => {\n"
+ " setTimeout(() => {\n"
+ " setTimeout(() => {\n"
+ " assertEquals(2, count++); TestsComplete = true;\n"
+ " });"
+ " assertEquals(1, count++);\n"
+ " }, 2);\n"
+ " assertEquals(0, count++);\n"
+ "});");
}

Expand Down

0 comments on commit 5b9ba19

Please sign in to comment.