fix race condition in test

Signed-off-by: Max Brunsfeld <mbrunsfeld@pivotallabs.com>