Improving test stability for CompletionTests

Randomized testing caught an issue showing that the test should
flush after indexing a document, as always the same document is
indexed.