Skip to content

Commit 5865cf8

Browse files
test: disable autoscaling on push to main and fix test_failFromWriterWhereKeepSessionStateOnFailoverIsTrue (#651)
1 parent 76fc8a2 commit 5865cf8

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.github/workflows/run-autoscaling-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: Run Autoscaling Tests
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
85

96
concurrency:
107
group: ${{ github.workflow }}-${{ github.ref }}

wrapper/src/test/java/integration/container/tests/AuroraFailoverTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -483,13 +483,14 @@ public void test_failFromWriterWhereKeepSessionStateOnFailoverIsTrue()
483483
conn.setAutoCommit(false);
484484

485485
final Statement testStmt1 = conn.createStatement();
486-
testStmt1.executeUpdate("DROP TABLE IF EXISTS test3_2");
486+
testStmt1.executeUpdate("DROP TABLE IF EXISTS test3_3");
487487
testStmt1.executeUpdate(
488-
"CREATE TABLE test3_2 (id int not null primary key, test3_2_field varchar(255) not null)");
488+
"CREATE TABLE test3_3 (id int not null primary key, test3_3_field varchar(255) not null)");
489489
conn.setAutoCommit(false); // open a new transaction
490+
conn.commit();
490491

491492
final Statement testStmt2 = conn.createStatement();
492-
testStmt2.executeUpdate("INSERT INTO test3_2 VALUES (1, 'test field string 1')");
493+
testStmt2.executeUpdate("INSERT INTO test3_3 VALUES (1, 'test field string 1')");
493494

494495
auroraUtil.failoverClusterAndWaitUntilWriterChanged();
495496

@@ -498,7 +499,7 @@ public void test_failFromWriterWhereKeepSessionStateOnFailoverIsTrue()
498499
assertThrows(
499500
SQLException.class,
500501
() ->
501-
testStmt2.executeUpdate("INSERT INTO test3_2 VALUES (2, 'test field string 2')"));
502+
testStmt2.executeUpdate("INSERT INTO test3_3 VALUES (2, 'test field string 2')"));
502503
assertEquals(
503504
SqlState.CONNECTION_FAILURE_DURING_TRANSACTION.getState(), exception.getSQLState());
504505

@@ -513,12 +514,13 @@ public void test_failFromWriterWhereKeepSessionStateOnFailoverIsTrue()
513514
// testStmt2 can NOT be used anymore since it's invalid
514515

515516
final Statement testStmt3 = conn.createStatement();
516-
final ResultSet rs = testStmt3.executeQuery("SELECT count(*) from test3_2");
517+
final ResultSet rs = testStmt3.executeQuery("SELECT count(*) from test3_3");
517518
rs.next();
518519
// Assert that NO row has been inserted to the table;
519520
assertEquals(0, rs.getInt(1));
520521

521-
testStmt3.executeUpdate("DROP TABLE IF EXISTS test3_2");
522+
testStmt3.executeUpdate("DROP TABLE IF EXISTS test3_3");
523+
conn.commit();
522524

523525
// Assert autocommit is still false after failover.
524526
assertFalse(conn.getAutoCommit());

0 commit comments

Comments
 (0)