refactor tests to work on linux and remove race conditions

Signed-off-by: Johannes Tuchscherer <jtuchscherer@pivotallabs.com>