From 7132983e1d85590ccdda21ddd7d920f8a724a049 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Wed, 22 Jan 2025 19:38:58 +1100 Subject: [PATCH] use tracked futures for showContinuousStatusUpdates --- tests/integration/testmanager.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/integration/testmanager.nim b/tests/integration/testmanager.nim index 7a0538bb..6ba2404a 100644 --- a/tests/integration/testmanager.nim +++ b/tests/integration/testmanager.nim @@ -6,6 +6,7 @@ import std/unittest import pkg/chronos import pkg/chronos/asyncproc import pkg/codex/logutils +import pkg/codex/utils/trackedfutures import pkg/questionable import pkg/questionable/results import ./hardhatprocess @@ -43,6 +44,7 @@ type hardhatPortLock: AsyncLock hardhatProcessLock: AsyncLock testTimeout: Duration # individual test timeout + trackedFutures: TrackedFutures IntegrationTestConfig* = object startHardhat: bool @@ -124,7 +126,8 @@ proc new*( debugTestHarness: debugTestHarness, debugHardhat: debugHardhat, debugCodexNodes: debugCodexNodes, - testTimeout: testTimeout + testTimeout: testTimeout, + trackedFutures: TrackedFutures.new(), ) func init*( @@ -550,6 +553,8 @@ proc start*( manager.printResult() proc stop*(manager: TestManager) {.async: (raises: [CancelledError]).} = + await manager.trackedFutures.cancelTracked() + for test in manager.tests: if not test.process.isNil and not test.process.finished: await test.process.cancelAndWait()