From c7ccab31e598e5457052780b0362ece550f4bf66 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 29 Apr 2021 16:48:12 -0700 Subject: [PATCH] test: fix flaky test-crypto-timing-safe-dqual-benchmarks Fixes: https://github.com/nodejs/node/issues/38226 PR-URL: https://github.com/nodejs/node/pull/38476 Reviewed-By: Antoine du Hamel Reviewed-By: Ruy Adorno Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 6 ++++-- test/pummel/test-crypto-timing-safe-equal-benchmarks.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 0b6e4a6fa6bfe6..81a9547b9071bc 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -46,7 +46,6 @@ const { ObjectGetPrototypeOf, ObjectPreventExtensions, ObjectSetPrototypeOf, - Proxy, ReflectGet, ReflectSet, SymbolToStringTag, @@ -108,8 +107,10 @@ const deprecationHandler = { get(target, key, receiver) { const val = ReflectGet(target, key, receiver); - if (val != null && typeof val === 'object') + if (val != null && typeof val === 'object') { + // eslint-disable-next-line node-core/prefer-primordials return new Proxy(val, deprecationHandler); + } return val; }, @@ -119,6 +120,7 @@ const deprecationHandler = { } }; +// eslint-disable-next-line node-core/prefer-primordials let processConfig = new Proxy( JSONParse(nativeModule.config), deprecationHandler); diff --git a/test/pummel/test-crypto-timing-safe-equal-benchmarks.js b/test/pummel/test-crypto-timing-safe-equal-benchmarks.js index b649b071e1e49d..3c6e31e8294cc8 100644 --- a/test/pummel/test-crypto-timing-safe-equal-benchmarks.js +++ b/test/pummel/test-crypto-timing-safe-equal-benchmarks.js @@ -111,7 +111,7 @@ assert( `timingSafeEqual should not leak information from its execution time (t=${t})` ); -// As a sanity check to make sure the statistical tests are working, run the +// As a coherence check to make sure the statistical tests are working, run the // same benchmarks again, this time with an unsafe comparison function. In this // case the t-value should be above the threshold. const unsafeCompare = (bufA, bufB) => bufA.equals(bufB);