There should be any waiting for a set time period. All waits should be for a specific state change.

Looking at other tests the call `FileIndexManager.markDirty();` it doesn't look like you need to wait here.