Fixed unit tests: wait until indexing terminated