Change test to avoid race condition

TODO: Explain what's going on here...