diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/BasePgSQLTest.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/BasePgSQLTest.java index d9f2e982bafe..1572c071c68e 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/BasePgSQLTest.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/BasePgSQLTest.java @@ -143,6 +143,15 @@ public class BasePgSQLTest extends BaseMiniClusterTest { " connections will share the same physical connection in a single threaded test if" + " no active transactions are there on the first connection"; + protected static final String CANNOT_GURANTEE_EXPECTED_PHYSICAL_CONN_FOR_CACHE = + "Test is designed in a way which requires every logical connection to have a dedicated " + + "physical connection. In the test backends are loaded with meta data of the object " + + "(tables) on executing DML with the premise (a) when withCachedMetadata is true, then " + + "the same backend processes the queries in a session (b) when withCachedMetadata is " + + "false, a new backend processes queries for a new connection (session). in both these " + + "cases the premise cannot be guaranteed when run with Connection Manager, hence skipping " + + "the tests with connection manager"; + protected static final String LESSER_PHYSICAL_CONNS = "Skipping this test with Ysql Connection Manager as logical connections " + "created are lesser than physical connections and the real maximum limit for creating " + diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestAlterTableWithConcurrentTxn.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestAlterTableWithConcurrentTxn.java index f7f1f4420935..8aae8277d121 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestAlterTableWithConcurrentTxn.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestAlterTableWithConcurrentTxn.java @@ -744,6 +744,8 @@ public void testDmlTransactionBeforeAlterOnCurrentResource() throws Exception { @Test public void testDmlTransactionAfterAlterOnCurrentResourceWithCachedMetadata() throws Exception { + assumeFalse(BasePgSQLTest.CANNOT_GURANTEE_EXPECTED_PHYSICAL_CONN_FOR_CACHE, + isTestRunningWithConnectionManager()); // Scenario 2. Execute any DML type after DDL. // a) For PG metadata cached table: // Transaction should conflict since we are using diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestDropTableWithConcurrentTxn.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestDropTableWithConcurrentTxn.java index 6f0d75912793..669e042a4fdc 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestDropTableWithConcurrentTxn.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestDropTableWithConcurrentTxn.java @@ -12,6 +12,7 @@ // package org.yb.pgsql; +import static org.junit.Assume.assumeFalse; import static org.yb.AssertionWrappers.assertEquals; import static org.yb.AssertionWrappers.assertTrue; @@ -395,11 +396,15 @@ public void testDmlTxnDropInternal() throws Exception { @Test public void testDmlTxnDrop() throws Exception { + assumeFalse(BasePgSQLTest.CANNOT_GURANTEE_EXPECTED_PHYSICAL_CONN_FOR_CACHE, + isTestRunningWithConnectionManager()); testDmlTxnDropInternal(); } @Test public void testDmlTxnDropWithReadCommitted() throws Exception { + assumeFalse(BasePgSQLTest.CANNOT_GURANTEE_EXPECTED_PHYSICAL_CONN_FOR_CACHE, + isTestRunningWithConnectionManager()); restartClusterWithFlags(Collections.emptyMap(), Collections.singletonMap("yb_enable_read_committed_isolation", "true"));