Skip to content

Commit

Permalink
Increase timeout in PrimaryFollowerAllocationIT
Browse files Browse the repository at this point in the history
A slow CI can take more than 10 seconds to relocate shards on the follower.
  • Loading branch information
dnhatn committed Aug 13, 2020
1 parent 7ab5b43 commit 74a1519
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;

import java.util.List;
import java.util.concurrent.TimeUnit;

import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.in;
Expand Down Expand Up @@ -59,10 +60,10 @@ public void testAllocateFollowerPrimaryToNodesWithRemoteClusterClientRole() thro
for (ShardRouting shard : shardRoutingTable) {
assertNotNull(shard.currentNodeId());
final DiscoveryNode assignedNode = state.nodes().get(shard.currentNodeId());
assertThat(assignedNode.getName(), in(dataOnlyNodes));
assertThat(shardRoutingTable.toString(), assignedNode.getName(), in(dataOnlyNodes));
}
}
});
}, 30, TimeUnit.SECONDS);
assertIndexFullyReplicatedToFollower(leaderIndex, followerIndex);
// Follower primaries can be recovered from the existing copies on nodes without the remote cluster client role
getFollowerCluster().fullRestart();
Expand All @@ -73,10 +74,10 @@ public void testAllocateFollowerPrimaryToNodesWithRemoteClusterClientRole() thro
for (ShardRouting shard : shardRoutingTable) {
assertNotNull(shard.currentNodeId());
final DiscoveryNode assignedNode = state.nodes().get(shard.currentNodeId());
assertThat(assignedNode.getName(), in(dataOnlyNodes));
assertThat(shardRoutingTable.toString(), assignedNode.getName(), in(dataOnlyNodes));
}
}
});
}, 30, TimeUnit.SECONDS);
int moreDocs = between(0, 20);
for (int i = 0; i < moreDocs; i++) {
leaderClient().prepareIndex(leaderIndex, "_doc").setSource("f", i).get();
Expand Down

0 comments on commit 74a1519

Please sign in to comment.