build(ci): fix internal benchmarks freeze
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 26 Nov 2023 15:50:46 +0000 (16:50 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 26 Nov 2023 15:50:46 +0000 (16:50 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
benchmarks/benchmarks-utils.js

index b7826a0c27ae06a75921df2df531128685c57afb..d779f8a75efb2c1b8eaa1287c602da1d33dc79e5 100644 (file)
@@ -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) {