From 0b37479701d85a65ec0be95aad1d2ddee9bcb2a3 Mon Sep 17 00:00:00 2001 From: Manav Kumar Date: Tue, 17 Sep 2024 07:59:51 +0000 Subject: [PATCH] [#23770] YSQL: Stabalize TestPgExplainAnalyze#testExplainAnalyzeOptions the test with ysql connection manager Summary: This diff makes `org.yb.pgsql.TestPgExplainAnalyze#testExplainAnalyzeOptions` test to run in round robin mode when ran with ysql connection manager as the test expects caching of results on the backend on running the query, therefore with round random mode we can deterministically populate the cache on each backend and run the test with ysql conn mgr. Jira: DB-12674 Test Plan: Jenkins: enable connection manager, test regex: .*ExplainAnalyze.* Ensure below test is working: `./yb_build.sh --enable-ysql-conn-mgr-test --java-test org.yb.pgsql.TestPgExplainAnalyze#testExplainAnalyzeOptions` Reviewers: skumar, rbarigidad Reviewed By: rbarigidad Differential Revision: https://phorge.dev.yugabyte.com/D37891 --- .../src/test/java/org/yb/pgsql/TestPgExplainAnalyze.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgExplainAnalyze.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgExplainAnalyze.java index 660277768213..010c17311478 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgExplainAnalyze.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgExplainAnalyze.java @@ -753,6 +753,12 @@ public void testDeleteReturning() throws Exception { @Test public void testExplainAnalyzeOptions() throws Exception { + if (isTestRunningWithConnectionManager()) { + // (DB-12674) Allow tests to run in round-robin allocation mode when + // using a pool of warmed up connections to allow for deterministic results. + setConnMgrWarmupModeAndRestartCluster(ConnectionManagerWarmupMode.ROUND_ROBIN); + setUp(); + } String query = String.format("SELECT * FROM %s", TABLE_NAME); try (Statement stmt = connection.createStatement()) { setHideNonDeterministicFields(stmt, true);