test(flaky): Log checkExpiring failure (#1018)

Add simple logging mechanism on checkExpiring failure.
This commit is contained in:
Álex Cabeza Romero 2024-02-06 17:47:13 +01:00 committed by GitHub
parent eb0890cd6f
commit 04af0c4323
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -122,7 +122,8 @@ proc checkExpiringInternal(cond: proc(): bool {.raises: [], gcsafe.} ): Future[b
await sleepAsync(1.millis)
template checkExpiring*(code: untyped): untyped =
check await checkExpiringInternal(proc(): bool = code)
let result = await checkExpiringInternal(proc(): bool = code)
assert result, "[TIMEOUT] Test failed due to the check timeout. Consider adjusting it."
proc unorderedCompare*[T](a, b: seq[T]): bool =
if a == b: