diff --git a/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java b/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java index afa9e2364a9..6284c1ee40b 100644 --- a/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java +++ b/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java @@ -121,7 +121,7 @@ public class NodeEnvironmentTests extends ElasticsearchTestCase { List locks = env.lockAllForIndex(new Index("foo"), settings, randomIntBetween(0, 10)); try { - env.shardLock(new ShardId("foo", randomIntBetween(0, 1))); + env.shardLock(new ShardId("foo", 0)); fail("shard is locked"); } catch (LockObtainFailedException ex) { // expected