mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-05 15:03:07 +00:00
ensure runTests doesn't raise CancelledError
TrackedFutures now only accepts Futures that do not raise any exceptions
This commit is contained in:
parent
338ee181d3
commit
6d1b924c41
@ -640,7 +640,7 @@ proc run(test: IntegrationTest) {.async: (raises: []).} =
|
||||
of IntegrationTestStatus.Ok:
|
||||
notice "Test passed"
|
||||
|
||||
proc runTests(manager: TestManager) {.async: (raises: [CancelledError]).} =
|
||||
proc runTests(manager: TestManager) {.async: (raises: []).} =
|
||||
var testFutures: seq[Future[void]]
|
||||
|
||||
manager.timeStart = some Moment.now()
|
||||
@ -658,14 +658,15 @@ proc runTests(manager: TestManager) {.async: (raises: [CancelledError]).} =
|
||||
let futRun = test.run()
|
||||
testFutures.add futRun
|
||||
|
||||
defer:
|
||||
try:
|
||||
await allFutures testFutures
|
||||
manager.timeEnd = some Moment.now()
|
||||
except CancelledError as e:
|
||||
discard
|
||||
finally:
|
||||
for fut in testFutures:
|
||||
await fut.cancelAndWait()
|
||||
|
||||
await allFutures testFutures
|
||||
|
||||
manager.timeEnd = some Moment.now()
|
||||
|
||||
proc withBorder(
|
||||
msg: string, align = Align.Left, width = 67, borders = {Border.Left, Border.Right}
|
||||
): string =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user