bombe
08/04/2019, 4:14 PMZach Klippenstein (he/him) [MOD]
08/05/2019, 4:02 PMZach Klippenstein (he/him) [MOD]
08/05/2019, 4:06 PMisCompleted
check, it would be better to check the return value of calledFirst.complete()
- this call will return false if the deferred was already completed.bombe
08/05/2019, 7:45 PMassertFailsWith
).Zach Klippenstein (he/him) [MOD]
08/05/2019, 7:58 PMbombe
08/05/2019, 8:09 PMa
, b
, and d
being printed but not the other ones, which must mean that await() actually does throw the exception; however, a stack trace is still printed to stderr, and the test still fails.Zach Klippenstein (he/him) [MOD]
08/06/2019, 7:44 PMasync
actually reports exceptions twice – it will send it up the Job
hierarchy (cancelling its parent), and throw it from await
. If you use an orphan Job
for the async
coroutine, i think it will pass (e.g. async(Job())
).bombe
08/06/2019, 7:46 PMbombe
08/06/2019, 7:47 PMbombe
08/06/2019, 7:49 PMsupervisorScope
that’s mentioned in `async`’s kdoc? How would I use that? Is that preferable? Do I only have this problem because this is test code?bombe
08/06/2019, 7:50 PMasync
in a supervisorScope
also allows the test to succeed.)bombe
08/06/2019, 7:53 PMZach Klippenstein (he/him) [MOD]
08/06/2019, 8:21 PMsupervisorScope
is better because your async will still get cancelled if the parent scope is cancelled. There was a lot of discussion about 6 months ago about how awkward the async
case is, but nothing seems to have come of it 😞Zach Klippenstein (he/him) [MOD]
08/06/2019, 8:22 PMAnd can I somehow verify that my use of coroutine stuff in the implementation is actually kind of correct?Besides the usual unit tests? I’m not aware of any formal verification static analysis tools for coroutines.
bombe
08/07/2019, 5:29 AM