Fixes race condition

Test assumed index fully populated at a particular point, but made no
effort to make it so.