[Tests] Remove unnecessary condition check (#28559)

The condition value in question is true, regardless of the randomBoolean() value.
This change simplifies this removing the condition blocks.
This commit is contained in:
Ke Li 2018-02-12 18:33:19 +08:00 committed by Christoph Büscher
parent 4aece92b2c
commit 55448b2630
2 changed files with 7 additions and 9 deletions

View File

@ -1146,12 +1146,12 @@ public class IndexShardTests extends IndexShardTestCase {
assertEquals(shard.shardPath().getRootStatePath().toString(), stats.getStatePath()); assertEquals(shard.shardPath().getRootStatePath().toString(), stats.getStatePath());
assertEquals(shard.shardPath().isCustomDataPath(), stats.isCustomDataPath()); assertEquals(shard.shardPath().isCustomDataPath(), stats.isCustomDataPath());
if (randomBoolean() || true) { // try to serialize it to ensure values survive the serialization // try to serialize it to ensure values survive the serialization
BytesStreamOutput out = new BytesStreamOutput(); BytesStreamOutput out = new BytesStreamOutput();
stats.writeTo(out); stats.writeTo(out);
StreamInput in = out.bytes().streamInput(); StreamInput in = out.bytes().streamInput();
stats = ShardStats.readShardStats(in); stats = ShardStats.readShardStats(in);
}
XContentBuilder builder = jsonBuilder(); XContentBuilder builder = jsonBuilder();
builder.startObject(); builder.startObject();
stats.toXContent(builder, EMPTY_PARAMS); stats.toXContent(builder, EMPTY_PARAMS);

View File

@ -121,10 +121,8 @@ public class GeoDistanceIT extends ESIntegTestCase {
// random cities with no location // random cities with no location
for (String cityName : Arrays.asList("london", "singapour", "tokyo", "milan")) { for (String cityName : Arrays.asList("london", "singapour", "tokyo", "milan")) {
if (randomBoolean() || true) {
cities.add(indexCity("idx-multi", cityName)); cities.add(indexCity("idx-multi", cityName));
} }
}
indexRandom(true, cities); indexRandom(true, cities);
prepareCreate("empty_bucket_idx") prepareCreate("empty_bucket_idx")
.addMapping("type", "value", "type=integer", "location", "type=geo_point").execute().actionGet(); .addMapping("type", "value", "type=integer", "location", "type=geo_point").execute().actionGet();