From d1e4d34afa1667e752795aeb5ca95700f5d9fd78 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 4 Dec 2020 05:45:21 -0800 Subject: [PATCH] test: skip flaky parts of broadcastchannel test on Windows The feature was added recently and is experimental. This will need to be fixed before it can be released as stable (in my opinion at least). But for now, this gets us to a green CI without skipping the parts of the test that are working on Windows. PR-URL: https://github.com/nodejs/node/pull/36386 Reviewed-By: Beth Griggs Reviewed-By: Richard Lau --- .../parallel/test-worker-broadcastchannel-wpt.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-worker-broadcastchannel-wpt.js b/test/parallel/test-worker-broadcastchannel-wpt.js index 4997eda4228c99..972d8fb6e0d3b8 100644 --- a/test/parallel/test-worker-broadcastchannel-wpt.js +++ b/test/parallel/test-worker-broadcastchannel-wpt.js @@ -27,7 +27,7 @@ const { // dispatching algorithm under the covers. What's not // immediately clear is whether the ordering is spec // mandated. In this test, c1 should receive events - // first, then c2, then c3. In the Node.js non-Windows dispatching + // first, then c2, then c3. In the Node.js dispatching // algorithm this means the ordering is: // from c3 (c1 from c3) // done (c1 from c2) @@ -36,7 +36,7 @@ const { // from c1 (c3 from c1) // done (c3 from c2) // - // Whereas in Windows and in the browser-ordering (as illustrated in the + // Whereas in the browser-ordering (as illustrated in the // Web Platform Tests) it would be: // from c1 (c2 from c1) // from c1 (c3 from c1) @@ -56,14 +56,9 @@ const { doneCount++; if (doneCount === 2) { assert.strictEqual(events.length, 6); - if (common.isWindows) { - assert.strictEqual(events[0].data, 'from c1'); - assert.strictEqual(events[2].data, 'from c1'); - assert.strictEqual(events[3].data, 'from c3'); - assert.strictEqual(events[3].data, 'from c3'); - assert.strictEqual(events[5].data, 'done'); - assert.strictEqual(events[5].data, 'done'); - } else { + // TODO: Don't skip Windows once ordering is fixed per comment above. + // Right now, the ordering for Windows is unreliable. + if (!common.isWindows) { assert.strictEqual(events[0].data, 'from c3'); assert.strictEqual(events[1].data, 'done'); assert.strictEqual(events[2].data, 'from c1'); @@ -132,7 +127,6 @@ const { { // TODO: Fix failure on Windows CI. Skipping for now. if (!common.isWindows) { - // Closing a channel in onmessage prevents already queued tasks // from firing onmessage events const c1 = new BroadcastChannel('close-in-onmessage2').unref();