Field notes / Note 013
The job that cancelled itself
2 min
A workout timer reached the end of its timeline and called its finish routine. The first line of that routine cancelled the loop that had called it.
Every suspending call after that threw a cancellation. The save was one of them. The session was never saved, and the timer sat on “DONE” for as long as anyone cared to watch.
The stop button worked, because it ran somewhere else. The unit test passed, because its fake repository never suspended.
A fake that is faster and more obedient than the real thing is testing a different program.