Skip to content

Commit e06037a

Browse files
committed
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: #35059 PR-URL: #35066 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent e56da06 commit e06037a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/parallel/test-trace-atomics-wait.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ const expectedTimelines = [
5454
[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
5555
[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
5656
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
57+
[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
58+
`${begin}
59+
[Thread 1] Atomics.wait(<address> + 4, 0, inf) started
60+
[Thread 0] Atomics.wait(<address> + 4, -1, inf) started
61+
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
5762
[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
5863
`${begin}
5964
[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
@@ -71,14 +76,20 @@ values mismatched`,
7176
[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
7277
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
7378
[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
79+
values mismatched`,
80+
`${begin}
81+
[Thread 1] Atomics.wait(<address> + 4, 0, inf) started
82+
[Thread 0] Atomics.wait(<address> + 4, -1, inf) started
83+
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
84+
[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
7485
values mismatched`,
7586
`${begin}
7687
[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
7788
[Thread 0] Atomics.wait(<address> + 4, 0, inf) did not wait because the \
7889
values mismatched
7990
[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
8091
[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
81-
values mismatched`
92+
values mismatched`,
8293
];
8394

8495
assert(expectedTimelines.includes(actualTimeline));

0 commit comments

Comments
 (0)