Skip to content

Commit

Permalink
Relax cluster metadata version check
Browse files Browse the repository at this point in the history
If the in_sync_allocations of index-1 or index-2 is changed, the
metadata version will be increased. This leads to the failure in
the metadata version checks. We need to relax them.

Closes elastic#37820
  • Loading branch information
dnhatn committed Jan 24, 2019
1 parent af2f4c8 commit 3ae4a71
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,19 @@ public void testMetadata() throws Exception {
assertThat(clusterStateResponse.getState().metaData().indices().size(), is(0));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/37820")
public void testMetadataVersion() {
createIndex("index-1");
createIndex("index-2");
long metadataVersion = client().admin().cluster().prepareState().get().getState().metaData().version();
assertThat(metadataVersion, greaterThan(0L));
long baselineVersion = client().admin().cluster().prepareState().get().getState().metaData().version();
assertThat(baselineVersion, greaterThan(0L));
assertThat(client().admin().cluster().prepareState().setIndices("index-1").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().setIndices("index-2").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().setIndices("*").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().setIndices("not-found").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().clear().setMetaData(false).get().getState().metaData().version(),
equalTo(0L));
}
Expand Down

0 comments on commit 3ae4a71

Please sign in to comment.