tests; fix race condition