From 87db574822e0860e0db00249b9f854c5b1d6eec6 Mon Sep 17 00:00:00 2001 From: Mohammad Kermani Date: Sun, 1 Oct 2023 17:29:27 +0330 Subject: [PATCH] fix(ergo-explorer, ergo-node): fix vitest hangup Because of a bug in vitest, it doesn't work correctly in multi-threaded mode on some operating systems (only in some situations). Disable threads to solve the issue. Please note that the usage of `singleThread: true` in vitest config is discouraged, as it runs all of the tests in the same environment, unlike `threads: false` which runs each test in a child process. Link to vitest issue (open at the time of commit): https://github.com/vitest-dev/vitest/issues/2008 --- packages/networks/ergo-explorer/vitest.config.ts | 1 + packages/networks/ergo-node/vitest.config.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/networks/ergo-explorer/vitest.config.ts b/packages/networks/ergo-explorer/vitest.config.ts index 1c63a83..ebc162a 100644 --- a/packages/networks/ergo-explorer/vitest.config.ts +++ b/packages/networks/ergo-explorer/vitest.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ }, mockReset: true, watch: false, + threads: false, }, plugins: [wasm(), topLevelAwait()], }); diff --git a/packages/networks/ergo-node/vitest.config.ts b/packages/networks/ergo-node/vitest.config.ts index 1c63a83..ebc162a 100644 --- a/packages/networks/ergo-node/vitest.config.ts +++ b/packages/networks/ergo-node/vitest.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ }, mockReset: true, watch: false, + threads: false, }, plugins: [wasm(), topLevelAwait()], });