Skip to content

Commit 74e7e5d

Browse files
fix(e2e): always clean up mysql.rds_configuration table via t.Cleanup
Register DROP TABLE in t.Cleanup at the start of TestMySQLRDSBinlogValidation so the table is guaranteed to be dropped even if the test fails early (e.g. due to an assertion mismatch). Without this, a test failure before the inline DROP TABLE left mysql.rds_configuration with a NULL value, causing all subsequent parallel MySQL tests to fail with the RDS binlog retention validation error. Co-authored-by: Pablo Francisco Pérez Hidalgo <pfcoperez@users.noreply.github.com>
1 parent 8a449a3 commit 74e7e5d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

flow/e2e/mysql_rds_binlog_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ func TestMySQLRDSBinlog(t *testing.T) {
7272
}
7373

7474
func (s MySQLRDSBinlogAPITestSuite) TestMySQLRDSBinlogValidation() {
75+
// Register cleanup before creating the table so it is always dropped even if the test fails early.
76+
s.t.Cleanup(func() {
77+
_ = s.source.Exec(context.Background(), "DROP TABLE IF EXISTS mysql.rds_configuration")
78+
})
79+
7580
require.NoError(s.t, s.source.Exec(s.t.Context(),
7681
fmt.Sprintf("CREATE TABLE %s(id int primary key, val text)", AttachSchema(s, "valid"))))
7782

@@ -109,6 +114,4 @@ func (s MySQLRDSBinlogAPITestSuite) TestMySQLRDSBinlogValidation() {
109114
res, err = s.ValidateCDCMirror(s.t.Context(), &protos.CreateCDCFlowRequest{ConnectionConfigs: flowConnConfig})
110115
require.NoError(s.t, err)
111116
require.NotNil(s.t, res)
112-
113-
require.NoError(s.t, s.source.Exec(s.t.Context(), "DROP TABLE IF EXISTS mysql.rds_configuration;"))
114117
}

0 commit comments

Comments
 (0)