bugfix: Fix unreleased issue with the worker's wait mechanism

This change also provides a correct test for the worker's ability to wait.
Previous test was completely wrong.

cc: @collin