mirror of
https://github.com/status-im/nim-codex.git
synced 2025-02-25 00:48:25 +00:00
use tracked futures for showContinuousStatusUpdates
This commit is contained in:
parent
b290ee758e
commit
7132983e1d
@ -6,6 +6,7 @@ import std/unittest
|
|||||||
import pkg/chronos
|
import pkg/chronos
|
||||||
import pkg/chronos/asyncproc
|
import pkg/chronos/asyncproc
|
||||||
import pkg/codex/logutils
|
import pkg/codex/logutils
|
||||||
|
import pkg/codex/utils/trackedfutures
|
||||||
import pkg/questionable
|
import pkg/questionable
|
||||||
import pkg/questionable/results
|
import pkg/questionable/results
|
||||||
import ./hardhatprocess
|
import ./hardhatprocess
|
||||||
@ -43,6 +44,7 @@ type
|
|||||||
hardhatPortLock: AsyncLock
|
hardhatPortLock: AsyncLock
|
||||||
hardhatProcessLock: AsyncLock
|
hardhatProcessLock: AsyncLock
|
||||||
testTimeout: Duration # individual test timeout
|
testTimeout: Duration # individual test timeout
|
||||||
|
trackedFutures: TrackedFutures
|
||||||
|
|
||||||
IntegrationTestConfig* = object
|
IntegrationTestConfig* = object
|
||||||
startHardhat: bool
|
startHardhat: bool
|
||||||
@ -124,7 +126,8 @@ proc new*(
|
|||||||
debugTestHarness: debugTestHarness,
|
debugTestHarness: debugTestHarness,
|
||||||
debugHardhat: debugHardhat,
|
debugHardhat: debugHardhat,
|
||||||
debugCodexNodes: debugCodexNodes,
|
debugCodexNodes: debugCodexNodes,
|
||||||
testTimeout: testTimeout
|
testTimeout: testTimeout,
|
||||||
|
trackedFutures: TrackedFutures.new(),
|
||||||
)
|
)
|
||||||
|
|
||||||
func init*(
|
func init*(
|
||||||
@ -550,6 +553,8 @@ proc start*(
|
|||||||
manager.printResult()
|
manager.printResult()
|
||||||
|
|
||||||
proc stop*(manager: TestManager) {.async: (raises: [CancelledError]).} =
|
proc stop*(manager: TestManager) {.async: (raises: [CancelledError]).} =
|
||||||
|
await manager.trackedFutures.cancelTracked()
|
||||||
|
|
||||||
for test in manager.tests:
|
for test in manager.tests:
|
||||||
if not test.process.isNil and not test.process.finished:
|
if not test.process.isNil and not test.process.finished:
|
||||||
await test.process.cancelAndWait()
|
await test.process.cancelAndWait()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user