More cautious testing in test_terminate_when_waiting