From 92e86eef3f230d9b6f5c96e32d4f645633fb35c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 26 Nov 2023 16:50:46 +0100 Subject: [PATCH] build(ci): fix internal benchmarks freeze MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- benchmarks/benchmarks-utils.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/benchmarks/benchmarks-utils.js b/benchmarks/benchmarks-utils.js index b7826a0c..d779f8a7 100644 --- a/benchmarks/benchmarks-utils.js +++ b/benchmarks/benchmarks-utils.js @@ -148,13 +148,24 @@ const runPoolifierPoolBenchmark = async ( .on('cycle', event => { console.info(event.target.toString()) }) - .on('complete', async function () { + .on('complete', function () { console.info( 'Fastest is ' + LIST_FORMATTER.format(this.filter('fastest').map('name')) ) - await pool.destroy() - resolve() + // FIXME: destroy() hangs + const destroyTimeout = setTimeout(() => { + resolve() + clearTimeout(destroyTimeout) + }, 30000) + pool + .destroy() + .then(resolve) + .catch(reject) + .finally(() => { + clearTimeout(destroyTimeout) + }) + .catch(() => {}) }) .run({ async: true }) } catch (error) { -- 2.34.1