test: make node-api/test_buffer/test_finalizer not flaky

PR-URL: https://github.com/nodejs/node/pull/43418
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
Matteo Collina
2022-06-14 08:57:14 +02:00
committed by Node.js GitHub Bot
parent 7fd4cf4673
commit 8bff086090

View File

@@ -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());