summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/action/support
diff options
context:
space:
mode:
authorBoaz Leskes <b.leskes@gmail.com>2017-02-09 23:10:23 +0200
committerBoaz Leskes <b.leskes@gmail.com>2017-02-09 23:14:09 +0200
commite0c8a6a3eb6ab088f0ba8c3a793c9132c9819914 (patch)
treee4d104f6eea2369f52d241f808c342664ee25e78 /core/src/test/java/org/elasticsearch/action/support
parentd43417ef47f69089ac054ea30ec75dae4584d2bc (diff)
Relax WaitActiveShardCountIT check of exception messages
So ti wouldn't depend on BulkShardRequest.toString()
Diffstat (limited to 'core/src/test/java/org/elasticsearch/action/support')
-rw-r--r--core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java b/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java
index d307c95735..6a33b8ae1d 100644
--- a/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java
+++ b/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java
@@ -33,6 +33,7 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueMillis;
import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.startsWith;
/**
* Tests setting the active shard count for replication operations (e.g. index) operates correctly.
@@ -53,7 +54,7 @@ public class WaitActiveShardCountIT extends ESIntegTestCase {
fail("can't index, does not enough active shard copies");
} catch (UnavailableShardsException e) {
assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE));
- assertThat(e.getMessage(), equalTo("[test][0] Not enough active copies to meet shard count of [2] (have 1, needed 2). Timeout: [100ms], request: [BulkShardRequest to [[test][0]] containing [1] requests]"));
+ assertThat(e.getMessage(), startsWith("[test][0] Not enough active copies to meet shard count of [2] (have 1, needed 2). Timeout: [100ms], request:"));
// but really, all is well
}
@@ -82,7 +83,7 @@ public class WaitActiveShardCountIT extends ESIntegTestCase {
fail("can't index, not enough active shard copies");
} catch (UnavailableShardsException e) {
assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE));
- assertThat(e.getMessage(), equalTo("[test][0] Not enough active copies to meet shard count of [" + ActiveShardCount.ALL + "] (have 2, needed 3). Timeout: [100ms], request: [BulkShardRequest to [[test][0]] containing [1] requests]"));
+ assertThat(e.getMessage(), startsWith("[test][0] Not enough active copies to meet shard count of [" + ActiveShardCount.ALL + "] (have 2, needed 3). Timeout: [100ms], request:"));
// but really, all is well
}