From da7fe7048a9372565988c16eb548c4f0a0c79119 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 5 Sep 2020 12:50:44 +0200 Subject: [PATCH] test: add more valid results to test-trace-atomics-wait The two starting `Atomics.wait()` operations are not ordered, but the test assumed a specific ordering because of the latency that comes with spinning up a Worker thread. Add variants of the existing potential valid results that account for the reverse ordering. Fixes: https://github.com/nodejs/node/issues/35059 --- test/parallel/test-trace-atomics-wait.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-trace-atomics-wait.js b/test/parallel/test-trace-atomics-wait.js index d925ffbe6c2cd4..03b76791586d98 100644 --- a/test/parallel/test-trace-atomics-wait.js +++ b/test/parallel/test-trace-atomics-wait.js @@ -54,6 +54,11 @@ const expectedTimelines = [ [Thread 0] Atomics.wait(
+ 4, 0, inf) started [Thread 1] Atomics.wait(
+ 4, -1, inf) started [Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread +[Thread 1] Atomics.wait(
+ 4, -1, inf) was woken up by another thread`, + `${begin} +[Thread 1] Atomics.wait(
+ 4, 0, inf) started +[Thread 0] Atomics.wait(
+ 4, -1, inf) started +[Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread [Thread 1] Atomics.wait(
+ 4, -1, inf) was woken up by another thread`, `${begin} [Thread 0] Atomics.wait(
+ 4, 0, inf) started @@ -71,6 +76,12 @@ values mismatched`, [Thread 1] Atomics.wait(
+ 4, -1, inf) started [Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread [Thread 1] Atomics.wait(
+ 4, -1, inf) did not wait because the \ +values mismatched`, + `${begin} +[Thread 1] Atomics.wait(
+ 4, 0, inf) started +[Thread 0] Atomics.wait(
+ 4, -1, inf) started +[Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread +[Thread 1] Atomics.wait(
+ 4, -1, inf) did not wait because the \ values mismatched`, `${begin} [Thread 0] Atomics.wait(
+ 4, 0, inf) started @@ -78,7 +89,7 @@ values mismatched`, values mismatched [Thread 1] Atomics.wait(
+ 4, -1, inf) started [Thread 1] Atomics.wait(
+ 4, -1, inf) did not wait because the \ -values mismatched` +values mismatched`, ]; assert(expectedTimelines.includes(actualTimeline));