diff --git a/harness/atomicsHelper.js b/harness/atomicsHelper.js index 81ed6d30d8c24769ff17dd59a531b39dfdf3da54..e14e5df976e7b2ddf3195e10022202c297240fac 100644 --- a/harness/atomicsHelper.js +++ b/harness/atomicsHelper.js @@ -35,7 +35,7 @@ function getReport() { * @param {Number} index The index of which all agents will report. * @param {Number} expected The number of agents that are expected to report as active. */ -function waitUntil(i32a, index, expected ) { +function waitUntil(i32a, index, expected) { var i = 0; while (Atomics.load(i32a, index) !== expected && i < 15) { $262.agent.sleep(10); diff --git a/test/built-ins/Atomics/wait/null-bufferdata-throws.js b/test/built-ins/Atomics/wait/null-bufferdata-throws.js index e9f5e0e7523aee25a491acffa9b6adbae359ab63..05f3d262b4b223dbac2cca0f1883bb3127cf0093 100644 --- a/test/built-ins/Atomics/wait/null-bufferdata-throws.js +++ b/test/built-ins/Atomics/wait/null-bufferdata-throws.js @@ -27,7 +27,7 @@ const poisoned = { }; try { - $DETACHBUFFER(i64a.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null + $DETACHBUFFER(i32a.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null } catch (error) { $ERROR(`An unexpected error occurred when detaching ArrayBuffer: ${error.message}`); } diff --git a/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js b/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js index 20a75c9e64b6e32f39b993153b5f113137be7dfa..8c4bf6decddffd45e4f3033da4b2cd9b31b954a5 100644 --- a/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js +++ b/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js @@ -38,9 +38,6 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT) ); - -const i32a = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); - $262.agent.broadcast(i32a.buffer); $262.agent.sleep(150); diff --git a/test/built-ins/Atomics/wake/wake-in-order.js b/test/built-ins/Atomics/wake/wake-in-order.js index 07675d49f48940a5ec23dd6ef673307fe1f2c8b7..7a5faedc6d5ce60a3a0fce494e37160f592c9d94 100644 --- a/test/built-ins/Atomics/wake/wake-in-order.js +++ b/test/built-ins/Atomics/wake/wake-in-order.js @@ -41,7 +41,7 @@ $262.agent.broadcast(i32a.buffer); // Wait for agents to be running. waitUntil(i32a, RUNNING, NUMAGENT); -// Then wait some more to give the agents a fair chance to wait. If we don't, +// Sleep to allow the agents a fair chance to wait. If we don't, // we risk sending the wakeup before agents are sleeping, and we hang. $262.agent.sleep(50); diff --git a/test/built-ins/Atomics/wake/wake-nan.js b/test/built-ins/Atomics/wake/wake-nan.js index 54a33f8f5bd27200f72108be0d0d5e27f7be65cd..0651be6b3170a2a045cd438848368eed22f81409 100644 --- a/test/built-ins/Atomics/wake/wake-nan.js +++ b/test/built-ins/Atomics/wake/wake-nan.js @@ -5,7 +5,7 @@ esid: sec-atomics.wake description: > Test that Atomics.wake wakes zero waiters if the count is NaN -includes: [testAtomics.js] +includes: [atomicsHelper.js,testAtomics.js] features: [ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ diff --git a/test/built-ins/Atomics/wake/wake-rewake-noop.js b/test/built-ins/Atomics/wake/wake-rewake-noop.js index 7d4c8e3f1abbfcea01a9df05c74f7ec20527c627..456ad7a64db97f28304264e7759959682d2b48a9 100644 --- a/test/built-ins/Atomics/wake/wake-rewake-noop.js +++ b/test/built-ins/Atomics/wake/wake-rewake-noop.js @@ -19,7 +19,7 @@ $262.agent.start(` `); const i32a = new Int32Array( - new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT) + new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2) ); $262.agent.broadcast(i32a.buffer); @@ -28,12 +28,7 @@ waitUntil(i32a, 1, 1); assert.sameValue(Atomics.wake(i32a, 0, 1), 1, 'Atomics.wake(i32a, 0, 1) returns 1'); -$262.agent.sleep(10); - -// Collect and check results -var report = getReport(); - -assert.sameValue(report, 'ok', 'The value of `report` is "ok"'); +assert.sameValue(getReport(), 'ok', 'The value of `report` is "ok"'); // Already awake, this should be a noop assert.sameValue(Atomics.wake(i32a, 0, 1), 0, 'Atomics.wake(i32a, 0, 1) returns 0'); diff --git a/test/built-ins/Atomics/wake/wake-two.js b/test/built-ins/Atomics/wake/wake-two.js index 6a9b790165f6a5eeeb979b4e8ee85b29fc70bfb6..6829f8f1d2e855cda5db7d87c387af9d8f092c56 100644 --- a/test/built-ins/Atomics/wake/wake-two.js +++ b/test/built-ins/Atomics/wake/wake-two.js @@ -29,7 +29,7 @@ for (var i = 0; i < NUMAGENT; i++ ) { } const i32a = new Int32Array( - new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT) + new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); $262.agent.broadcast(i32a.buffer); diff --git a/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js b/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js index 83ebc27f34b445684aec3bfaf25fc99418e6658e..abd003e89fe21a6a1286b4d94e4a90d013dd30aa 100644 --- a/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js +++ b/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js @@ -19,7 +19,7 @@ $262.agent.start(` `); const i32a = new Int32Array( - new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT) + new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2) ); $262.agent.broadcast(i32a.buffer); diff --git a/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js b/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js index e967a85eeaf69ff3250e256f920b285a0715e4d1..4ce6cfe3f71419471b6b647df05ad35a9471463a 100644 --- a/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js +++ b/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js @@ -20,7 +20,7 @@ $262.agent.start(` `); const i32a = new Int32Array( - new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT) + new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2) ); $262.agent.broadcast(i32a.buffer);