hardening test against race conditions