test: use mustCall() for simple flow tracking
Checklist
-
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
test
Description of change
Many of the tests use variables to track when callback functions are invoked or events are emitted. These variables are then asserted on process exit. This commit replaces this pattern in straightforward cases with common.mustCall()
. This makes the tests easier to reason about, leads to a net reduction in lines of code, and uncovered a few bugs in tests.