The test introduces an artificial inconsistency and checks that a refresh eventually leads to automatically solve the issue.
When the periodic index kicks in during the test, the aggregation it executes may trigger a refresh earlier than expected causing spurious test failures.
The solution should be to simply copy this snippet to disable the periodic index consistency thread in this specific test.