From 06deb94714ddb5e18a803c517e9272a8fe657995 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 1 Feb 2020 14:27:35 +0100 Subject: [PATCH] test: fix flaky test-memory-usage abe6a2e3d1c268f introduced a test that verifies that ArrayBuffer allocations are tracked. However, V8 supports concurrent freeing of such allocations on background threads, meaning that the results may be subject to race conditions sometimes. Disabling concurrent freeing makes the test pass consistently. Refs: https://github.com/nodejs/node/pull/31550 PR-URL: https://github.com/nodejs/node/pull/31602 Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig Reviewed-By: Denys Otrishko Reviewed-By: James M Snell --- test/parallel/test-memory-usage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-memory-usage.js b/test/parallel/test-memory-usage.js index a1d07c64776068..abd5bba7bb3f41 100644 --- a/test/parallel/test-memory-usage.js +++ b/test/parallel/test-memory-usage.js @@ -19,6 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +// Flags: --no-concurrent-array-buffer-freeing 'use strict'; const common = require('../common'); const assert = require('assert'); @@ -41,5 +42,5 @@ if (r.arrayBuffers > 0) { assert(after.external - r.external >= size, `${after.external} - ${r.external} >= ${size}`); assert.strictEqual(after.arrayBuffers - r.arrayBuffers, size, - `${after.arrayBuffers} - ${r.arrayBuffers} >= ${size}`); + `${after.arrayBuffers} - ${r.arrayBuffers} === ${size}`); }