Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
addaleax committed Sep 5, 2020
commit da7fe7048a9372565988c16eb548c4f0a0c79119
13 changes: 12 additions & 1 deletion test/parallel/test-trace-atomics-wait.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ const expectedTimelines = [
[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
`${begin}
[Thread 1] Atomics.wait(<address> + 4, 0, inf) started
[Thread 0] Atomics.wait(<address> + 4, -1, inf) started
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
`${begin}
[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
Expand All @@ -71,14 +76,20 @@ values mismatched`,
[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
values mismatched`,
`${begin}
[Thread 1] Atomics.wait(<address> + 4, 0, inf) started
[Thread 0] Atomics.wait(<address> + 4, -1, inf) started
[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
values mismatched`,
`${begin}
[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
[Thread 0] Atomics.wait(<address> + 4, 0, inf) did not wait because the \
values mismatched
[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
values mismatched`
values mismatched`,
];

assert(expectedTimelines.includes(actualTimeline));