Skip to content

Commit

Permalink
Use cluster_manager_tiemout in rhlc
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <[email protected]>
  • Loading branch information
Tianli Feng committed Mar 31, 2022
1 parent e051a42 commit 2dfb976
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ Params withFields(String[] fields) {
}

Params withMasterTimeout(TimeValue masterTimeout) {
return putParam("master_timeout", masterTimeout);
return putParam("cluster_manager_timeout", masterTimeout);
}

Params withPipeline(String pipeline) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,23 @@ public void testClusterHealth() {
case "timeout":
healthRequest.timeout(timeout);
expectedParams.put("timeout", timeout);
// If Master Timeout wasn't set it uses the same value as Timeout
expectedParams.put("master_timeout", timeout);
// If Cluster Manager Timeout wasn't set it uses the same value as Timeout
expectedParams.put("cluster_manager_timeout", timeout);
break;
case "masterTimeout":
expectedParams.put("timeout", "30s");
healthRequest.masterNodeTimeout(masterTimeout);
expectedParams.put("master_timeout", masterTimeout);
expectedParams.put("cluster_manager_timeout", masterTimeout);
break;
case "both":
healthRequest.timeout(timeout);
expectedParams.put("timeout", timeout);
healthRequest.masterNodeTimeout(timeout);
expectedParams.put("master_timeout", timeout);
expectedParams.put("cluster_manager_timeout", timeout);
break;
case "none":
expectedParams.put("timeout", "30s");
expectedParams.put("master_timeout", "30s");
expectedParams.put("cluster_manager_timeout", "30s");
break;
default:
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2120,19 +2120,19 @@ static void setRandomMasterTimeout(Consumer<String> setter, Map<String, String>
if (randomBoolean()) {
String masterTimeout = randomTimeValue();
setter.accept(masterTimeout);
expectedParams.put("master_timeout", masterTimeout);
expectedParams.put("cluster_manager_timeout", masterTimeout);
} else {
expectedParams.put("master_timeout", MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT.getStringRep());
expectedParams.put("cluster_manager_timeout", MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT.getStringRep());
}
}

static void setRandomMasterTimeout(Consumer<TimeValue> setter, TimeValue defaultTimeout, Map<String, String> expectedParams) {
if (randomBoolean()) {
TimeValue masterTimeout = TimeValue.parseTimeValue(randomTimeValue(), "random_master_timeout");
setter.accept(masterTimeout);
expectedParams.put("master_timeout", masterTimeout.getStringRep());
expectedParams.put("cluster_manager_timeout", masterTimeout.getStringRep());
} else {
expectedParams.put("master_timeout", defaultTimeout.getStringRep());
expectedParams.put("cluster_manager_timeout", defaultTimeout.getStringRep());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void testRestoreSnapshot() throws IOException {
if (randomBoolean()) {
String timeout = randomTimeValue();
restoreSnapshotRequest.masterNodeTimeout(timeout);
expectedParams.put("master_timeout", timeout);
expectedParams.put("cluster_manager_timeout", timeout);
}

Request request = SnapshotRequestConverters.restoreSnapshot(restoreSnapshotRequest);
Expand Down

0 comments on commit 2dfb976

Please sign in to comment.