From 3948accbf4f5b96ba31696bef940a0e88f76d158 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Tue, 14 Jun 2022 08:57:14 +0200 Subject: [PATCH] test: make node-api/test_buffer/test_finalizer not flaky MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/43418 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Chengzhong Wu Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Michael Dawson --- test/node-api/test_buffer/test_finalizer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/node-api/test_buffer/test_finalizer.js b/test/node-api/test_buffer/test_finalizer.js index e9bdd53c6dff8e..372116bb3a05fc 100644 --- a/test/node-api/test_buffer/test_finalizer.js +++ b/test/node-api/test_buffer/test_finalizer.js @@ -16,6 +16,10 @@ process.on('uncaughtException', common.mustCall((err) => { throw new Error('finalizer error'); })); } + global.gc(true); + await tick(common.platformTimeout(100)); global.gc(); - await tick(10); + await tick(common.platformTimeout(100)); + global.gc(); + await tick(common.platformTimeout(100)); })().then(common.mustCall());