The testPerformAction test has been failing periodically due to how Hamcrest's containsStringIgnoringCase does not lowercase using the same Locale set in the test infrastructure. This commit falls back to explicitly lowercasing using the root locale
This commit is contained in:
parent
f27ce69f0c
commit
c370b83bd7
|
@ -12,11 +12,13 @@ import org.elasticsearch.cluster.metadata.IndexMetadata;
|
|||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.common.Strings;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ilm.AbstractStepMasterTimeoutTestCase.emptyClusterState;
|
||||
import static org.elasticsearch.xpack.core.ilm.GenerateSnapshotNameStep.generateSnapshotName;
|
||||
import static org.elasticsearch.xpack.core.ilm.GenerateSnapshotNameStep.validateGeneratedSnapshotName;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.containsStringIgnoringCase;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
|
@ -75,8 +77,8 @@ public class GenerateSnapshotNameStepTests extends AbstractStepTestCase<Generate
|
|||
assertThat("the " + GenerateSnapshotNameStep.NAME + " step must generate a snapshot name", executionState.getSnapshotName(),
|
||||
notNullValue());
|
||||
assertThat(executionState.getSnapshotRepository(), is(generateSnapshotNameStep.getSnapshotRepository()));
|
||||
assertThat(executionState.getSnapshotName(), containsStringIgnoringCase(indexName));
|
||||
assertThat(executionState.getSnapshotName(), containsStringIgnoringCase(policyName));
|
||||
assertThat(executionState.getSnapshotName(), containsString(indexName.toLowerCase(Locale.ROOT)));
|
||||
assertThat(executionState.getSnapshotName(), containsString(policyName.toLowerCase(Locale.ROOT)));
|
||||
}
|
||||
|
||||
public void testNameGeneration() {
|
||||
|
|
Loading…
Reference in New Issue