Skip to content

Commit

Permalink
[#10967] Increase default admin operation timeout in Java tests
Browse files Browse the repository at this point in the history
Summary:
This might help with the recent increased number of "waiting for master leader" test failures that do not seem to be caused by any specific recent code change, but might be a test infrastructure issue.

Test Plan: Jenkins

Reviewers: sergei, alex, bogdan

Reviewed By: bogdan

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D14617
  • Loading branch information
mbautin committed Jan 5, 2022
1 parent d104dde commit a5e2d82
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion java/yb-client/src/main/java/org/yb/client/YBClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ public void waitForMasterLeader(long timeoutMs) throws Exception {
String leaderUuid = waitAndGetLeaderMasterUUID(timeoutMs);

if (leaderUuid == null) {
throw new RuntimeException("Timed out waiting for Master Leader.");
throw new RuntimeException(
"Timed out waiting for Master Leader after " + timeoutMs + " ms");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.yb.tserver.TserverTypes.TabletServerErrorPB;
import org.yb.util.Pair;
import org.yb.util.Timeouts;
import org.yb.minicluster.MiniYBClusterParameters;
import static org.yb.AssertionWrappers.assertEquals;
import static org.yb.AssertionWrappers.assertFalse;
import static org.yb.AssertionWrappers.assertNotEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ public void startSyncClientAndWaitForMasterLeader() throws Exception {

public void startSyncClient(boolean waitForMasterLeader) throws Exception {
syncClient = new YBClient.YBClientBuilder(getMasterAddresses())
.defaultAdminOperationTimeoutMs(clusterParameters.defaultTimeoutMs)
.defaultAdminOperationTimeoutMs(clusterParameters.defaultAdminOperationTimeoutMs)
.defaultOperationTimeoutMs(clusterParameters.defaultTimeoutMs)
.sslCertFile(certFile)
.sslClientCertFiles(clientCertFile, clientKeyFile)
.bindHostAddress(clientHost, clientPort)
.build();

if (waitForMasterLeader) {
syncClient.waitForMasterLeader(clusterParameters.defaultTimeoutMs);
syncClient.waitForMasterLeader(clusterParameters.defaultAdminOperationTimeoutMs);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ public class MiniYBClusterParameters {
public static final int DEFAULT_NUM_SHARDS_PER_TSERVER = 3;
public static boolean DEFAULT_USE_IP_WITH_CERTIFICATE = false;

public static final int DEFAULT_ADMIN_OPERATION_TIMEOUT_MS = 90000;

public int numMasters = 1;
public int numTservers = DEFAULT_NUM_TSERVERS;
public int numShardsPerTServer = DEFAULT_NUM_SHARDS_PER_TSERVER;
public boolean useIpWithCertificate = DEFAULT_USE_IP_WITH_CERTIFICATE;
public int defaultTimeoutMs = 50000;
public int defaultAdminOperationTimeoutMs = DEFAULT_ADMIN_OPERATION_TIMEOUT_MS;
public int replicationFactor = -1;
public boolean startYsqlProxy = false;
public boolean pgTransactionsEnabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class TestClusterBase extends BaseCQLTest {
protected static final int WEBSERVER_TIMEOUT_MS = 10000; // 10 seconds.

// Timeout to wait for a master leader.
protected static final int MASTER_LEADER_TIMEOUT_MS = 10000; // 10 seconds.
protected static final int MASTER_LEADER_TIMEOUT_MS = 90000;

// Timeout to wait expected number of tservers to be alive.
protected static final int EXPECTED_TSERVERS_TIMEOUT_MS = 30000; // 30 seconds.
Expand Down

0 comments on commit a5e2d82

Please sign in to comment.