Skip to content

Commit

Permalink
Fix testRestoreIncreasesPrimaryTerms on 6.x (#38314)
Browse files Browse the repository at this point in the history
In 6.x the open index request does not wait for shards to be active and
returns immediately. In this specific test, we want to capture the
values of the primary terms before the snapshot and restore and if it
does not wait for shard to be active the captured values might not be
up to date.

Closes #38223
  • Loading branch information
tlrx authored Feb 4, 2019
1 parent 21f2c03 commit 956c5cd
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3706,7 +3706,6 @@ public void testAbortedSnapshotDuringInitDoesNotStart() throws Exception {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/38223")
public void testRestoreIncreasesPrimaryTerms() {
final String indexName = randomAlphaOfLengthBetween(5, 10).toLowerCase(Locale.ROOT);
createIndex(indexName, Settings.builder()
Expand All @@ -3719,7 +3718,7 @@ public void testRestoreIncreasesPrimaryTerms() {
// open and close the index to increase the primary terms
for (int i = 0; i < randomInt(3); i++) {
assertAcked(client().admin().indices().prepareClose(indexName));
assertAcked(client().admin().indices().prepareOpen(indexName));
assertAcked(client().admin().indices().prepareOpen(indexName).setWaitForActiveShards(ActiveShardCount.ONE));
}
}

Expand Down

0 comments on commit 956c5cd

Please sign in to comment.