1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-16 00:07:40 +00:00

Ensure ev/gather fibers are fully canceled on error.

This commit is contained in:
Christopher Chambers
2023-06-04 09:59:10 -04:00
parent c4c86f8671
commit 53447e9d0b
2 changed files with 14 additions and 3 deletions

View File

@@ -168,6 +168,13 @@
(assert (deep= @[] (ev/gather)) "ev/gather 2")
(assert-error "ev/gather 3" (ev/gather 1 2 (error 3)))
(var cancel-counter 0)
(assert-error "ev/gather 4.1" (ev/gather
(defer (++ cancel-counter) (ev/take (ev/chan)))
(defer (++ cancel-counter) (ev/take (ev/chan)))
(error :oops)))
(assert (= cancel-counter 2) "ev/gather 4.2")
# Net testing
# 2904c19ed
(repeat 10