Fix flakey test.

This would fail occasionally if these steps took longer than a second to
complete.