From 914ab0280cdee1280adc22f6ed4b1268028bc84d Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 8 May 2020 10:01:32 -0400 Subject: [PATCH] Atomics.waitAsync: prevent in-agent tests from hanging by checking for Atomics.waitAsync at start of test --- test/built-ins/Atomics/waitAsync/false-for-timeout-agent.js | 2 ++ test/built-ins/Atomics/waitAsync/good-views.js | 1 + test/built-ins/Atomics/waitAsync/nan-for-timeout-agent.js | 1 + test/built-ins/Atomics/waitAsync/negative-timeout-agent.js | 1 + .../Atomics/waitAsync/no-spurious-wakeup-no-operation.js | 1 + test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-add.js | 1 + test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-and.js | 1 + .../Atomics/waitAsync/no-spurious-wakeup-on-compareExchange.js | 1 + .../Atomics/waitAsync/no-spurious-wakeup-on-exchange.js | 1 + test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-or.js | 1 + test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-store.js | 1 + test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-sub.js | 1 + test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-xor.js | 1 + test/built-ins/Atomics/waitAsync/null-for-timeout-agent.js | 1 + test/built-ins/Atomics/waitAsync/object-for-timeout-agent.js | 2 ++ .../waitAsync/poisoned-object-for-timeout-throws-agent.js | 1 + .../Atomics/waitAsync/symbol-for-index-throws-agent.js | 2 ++ .../Atomics/waitAsync/symbol-for-timeout-throws-agent.js | 1 + .../Atomics/waitAsync/symbol-for-value-throws-agent.js | 2 ++ test/built-ins/Atomics/waitAsync/true-for-timeout-agent.js | 2 ++ test/built-ins/Atomics/waitAsync/undefined-for-timeout-agent.js | 1 + .../Atomics/waitAsync/undefined-index-defaults-to-zero-agent.js | 2 ++ test/built-ins/Atomics/waitAsync/value-not-equal-agent.js | 2 ++ .../Atomics/waitAsync/waiterlist-block-indexedposition-wake.js | 2 ++ test/built-ins/Atomics/waitAsync/was-woken-before-timeout.js | 2 ++ 25 files changed, 34 insertions(+) diff --git a/test/built-ins/Atomics/waitAsync/false-for-timeout-agent.js b/test/built-ins/Atomics/waitAsync/false-for-timeout-agent.js index 0b274263cb..abf7c19efe 100644 --- a/test/built-ins/Atomics/waitAsync/false-for-timeout-agent.js +++ b/test/built-ins/Atomics/waitAsync/false-for-timeout-agent.js @@ -18,6 +18,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const RUNNING = 1; $262.agent.start(` diff --git a/test/built-ins/Atomics/waitAsync/good-views.js b/test/built-ins/Atomics/waitAsync/good-views.js index d7f3a8c348..a376d042dd 100644 --- a/test/built-ins/Atomics/waitAsync/good-views.js +++ b/test/built-ins/Atomics/waitAsync/good-views.js @@ -8,6 +8,7 @@ description: > includes: [atomicsHelper.js] features: [Atomics.waitAsync, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); $262.agent.start(` (async () => { diff --git a/test/built-ins/Atomics/waitAsync/nan-for-timeout-agent.js b/test/built-ins/Atomics/waitAsync/nan-for-timeout-agent.js index 2455694fe5..9158693e20 100644 --- a/test/built-ins/Atomics/waitAsync/nan-for-timeout-agent.js +++ b/test/built-ins/Atomics/waitAsync/nan-for-timeout-agent.js @@ -18,6 +18,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; diff --git a/test/built-ins/Atomics/waitAsync/negative-timeout-agent.js b/test/built-ins/Atomics/waitAsync/negative-timeout-agent.js index e3fa5ae14f..922117219a 100644 --- a/test/built-ins/Atomics/waitAsync/negative-timeout-agent.js +++ b/test/built-ins/Atomics/waitAsync/negative-timeout-agent.js @@ -18,6 +18,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-no-operation.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-no-operation.js index 4611b6ae59..bd6413320b 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-no-operation.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-no-operation.js @@ -26,6 +26,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-add.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-add.js index 49f7fe7f3b..8920b03d9e 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-add.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-add.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-and.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-and.js index ad685bc74e..25f27b9c65 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-and.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-and.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-compareExchange.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-compareExchange.js index f50c92adeb..6d4217e4d4 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-compareExchange.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-compareExchange.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-exchange.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-exchange.js index 9f3331ddc3..2ea1907408 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-exchange.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-exchange.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-or.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-or.js index a304ef821c..ae66f2dfb5 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-or.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-or.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-store.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-store.js index 01dd07696c..e64e7ed1ec 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-store.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-store.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-sub.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-sub.js index ce9cf43357..ff429c1a93 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-sub.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-sub.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-xor.js b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-xor.js index 7983024518..43c8a245d2 100644 --- a/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-xor.js +++ b/test/built-ins/Atomics/waitAsync/no-spurious-wakeup-on-xor.js @@ -25,6 +25,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.small; diff --git a/test/built-ins/Atomics/waitAsync/null-for-timeout-agent.js b/test/built-ins/Atomics/waitAsync/null-for-timeout-agent.js index cebece1527..1d32f0252f 100644 --- a/test/built-ins/Atomics/waitAsync/null-for-timeout-agent.js +++ b/test/built-ins/Atomics/waitAsync/null-for-timeout-agent.js @@ -20,6 +20,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; diff --git a/test/built-ins/Atomics/waitAsync/object-for-timeout-agent.js b/test/built-ins/Atomics/waitAsync/object-for-timeout-agent.js index 41cd565b19..2277612a90 100644 --- a/test/built-ins/Atomics/waitAsync/object-for-timeout-agent.js +++ b/test/built-ins/Atomics/waitAsync/object-for-timeout-agent.js @@ -23,6 +23,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const RUNNING = 1; $262.agent.start(` diff --git a/test/built-ins/Atomics/waitAsync/poisoned-object-for-timeout-throws-agent.js b/test/built-ins/Atomics/waitAsync/poisoned-object-for-timeout-throws-agent.js index 9cf832c525..d7e6ec156f 100644 --- a/test/built-ins/Atomics/waitAsync/poisoned-object-for-timeout-throws-agent.js +++ b/test/built-ins/Atomics/waitAsync/poisoned-object-for-timeout-throws-agent.js @@ -21,6 +21,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; diff --git a/test/built-ins/Atomics/waitAsync/symbol-for-index-throws-agent.js b/test/built-ins/Atomics/waitAsync/symbol-for-index-throws-agent.js index 61d35098b6..8ef2c9858a 100644 --- a/test/built-ins/Atomics/waitAsync/symbol-for-index-throws-agent.js +++ b/test/built-ins/Atomics/waitAsync/symbol-for-index-throws-agent.js @@ -33,6 +33,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const RUNNING = 1; $262.agent.start(` diff --git a/test/built-ins/Atomics/waitAsync/symbol-for-timeout-throws-agent.js b/test/built-ins/Atomics/waitAsync/symbol-for-timeout-throws-agent.js index 406e2dce74..546f241c40 100644 --- a/test/built-ins/Atomics/waitAsync/symbol-for-timeout-throws-agent.js +++ b/test/built-ins/Atomics/waitAsync/symbol-for-timeout-throws-agent.js @@ -20,6 +20,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const RUNNING = 1; diff --git a/test/built-ins/Atomics/waitAsync/symbol-for-value-throws-agent.js b/test/built-ins/Atomics/waitAsync/symbol-for-value-throws-agent.js index d843d5bd00..c4b9eb38de 100644 --- a/test/built-ins/Atomics/waitAsync/symbol-for-value-throws-agent.js +++ b/test/built-ins/Atomics/waitAsync/symbol-for-value-throws-agent.js @@ -24,6 +24,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const RUNNING = 1; $262.agent.start(` diff --git a/test/built-ins/Atomics/waitAsync/true-for-timeout-agent.js b/test/built-ins/Atomics/waitAsync/true-for-timeout-agent.js index c45c57494a..061d1bffaa 100644 --- a/test/built-ins/Atomics/waitAsync/true-for-timeout-agent.js +++ b/test/built-ins/Atomics/waitAsync/true-for-timeout-agent.js @@ -18,6 +18,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const RUNNING = 1; $262.agent.start(` diff --git a/test/built-ins/Atomics/waitAsync/undefined-for-timeout-agent.js b/test/built-ins/Atomics/waitAsync/undefined-for-timeout-agent.js index d596e3fab8..8f60642eb5 100644 --- a/test/built-ins/Atomics/waitAsync/undefined-for-timeout-agent.js +++ b/test/built-ins/Atomics/waitAsync/undefined-for-timeout-agent.js @@ -22,6 +22,7 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); const WAIT_INDEX = 0; const RUNNING = 1; diff --git a/test/built-ins/Atomics/waitAsync/undefined-index-defaults-to-zero-agent.js b/test/built-ins/Atomics/waitAsync/undefined-index-defaults-to-zero-agent.js index ec6c64e865..d1d603f119 100644 --- a/test/built-ins/Atomics/waitAsync/undefined-index-defaults-to-zero-agent.js +++ b/test/built-ins/Atomics/waitAsync/undefined-index-defaults-to-zero-agent.js @@ -26,6 +26,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const WAIT_INDEX = 0; const RUNNING = 1; const NUMAGENT = 2; diff --git a/test/built-ins/Atomics/waitAsync/value-not-equal-agent.js b/test/built-ins/Atomics/waitAsync/value-not-equal-agent.js index 09e0e10db0..925ce2342c 100644 --- a/test/built-ins/Atomics/waitAsync/value-not-equal-agent.js +++ b/test/built-ins/Atomics/waitAsync/value-not-equal-agent.js @@ -24,6 +24,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const RUNNING = 1; const value = 42; diff --git a/test/built-ins/Atomics/waitAsync/waiterlist-block-indexedposition-wake.js b/test/built-ins/Atomics/waitAsync/waiterlist-block-indexedposition-wake.js index f183bff6e8..d2654e4138 100644 --- a/test/built-ins/Atomics/waitAsync/waiterlist-block-indexedposition-wake.js +++ b/test/built-ins/Atomics/waitAsync/waiterlist-block-indexedposition-wake.js @@ -24,6 +24,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const NUMAGENT = 2; const RUNNING = 4; diff --git a/test/built-ins/Atomics/waitAsync/was-woken-before-timeout.js b/test/built-ins/Atomics/waitAsync/was-woken-before-timeout.js index b1087b04fe..49e0407315 100644 --- a/test/built-ins/Atomics/waitAsync/was-woken-before-timeout.js +++ b/test/built-ins/Atomics/waitAsync/was-woken-before-timeout.js @@ -9,6 +9,8 @@ flags: [async] includes: [atomicsHelper.js] features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics] ---*/ +assert.sameValue(typeof Atomics.waitAsync, 'function'); + const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.huge;