I only thought of a way to make this work by changing the contract of IClock#every - now it is supposed to wrap the passed-in function into a self-cancelling runnable.
Before this change the attached test-mock-clock-deschedules-after-exception deadlocks on the first every execution. The exception handling code waits for the return value of every which never happens as it's running on the same thread.
I only thought of a way to make this work by changing the contract of
IClock#every
- now it is supposed to wrap the passed-in function into a self-cancelling runnable.Before this change the attached
test-mock-clock-deschedules-after-exception
deadlocks on the firstevery
execution. The exception handling code waits for the return value ofevery
which never happens as it's running on the same thread.