Add blocking in unit tests for more determinism