From 48aaebf23d8067a54d4e06b8afc985d1a6476f42 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 24 Mar 2016 09:52:12 -0400 Subject: [PATCH] [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 --- .../index/reindex/AsyncBulkByScrollActionTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java index 06f5226a7f4..b734a555fa7 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java @@ -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())); } }