Fix race conditions (mostly in tests)

[#74312096]

Signed-off-by: John Tuley <jtuley@pivotal.io>