[reindex] Wait for headers

The test was checking that we'd set the headers properly but in some cases
the request had yet to come in because it was running on another thread.
Now we wait for the headers to show up before failing the test.

Closes #17299
This commit is contained in:
Nik Everett 2016-03-24 09:52:12 -04:00
parent baec7bc23c
commit 48aaebf23d
1 changed files with 6 additions and 1 deletions

View File

@ -178,7 +178,12 @@ public class AsyncBulkByScrollActionTests extends ESTestCase {
* isn't counted as time that the last batch took.
*/
assertThat(action.getLastBatchStartTime(), greaterThanOrEqualTo(now));
assertEquals(expectedHeaders, client.lastHeaders.get());
/*
* Also while we're here check that we preserved the headers from the last request. assertBusy because no requests might have
* come in yet.
*/
assertBusy(() -> assertEquals(expectedHeaders, client.lastHeaders.get()));
}
}