From 40bf0c21e558e85711cd4bc9a89fa7bac29f9990 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Tue, 11 Jun 2024 17:21:35 +0800 Subject: [PATCH 1/2] * fix flaky test in the TestTiDBTrx Signed-off-by: Weizhen Wang --- pkg/infoschema/test/clustertablestest/tables_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/infoschema/test/clustertablestest/tables_test.go b/pkg/infoschema/test/clustertablestest/tables_test.go index 978be9e23d14e..7b7b769c857b7 100644 --- a/pkg/infoschema/test/clustertablestest/tables_test.go +++ b/pkg/infoschema/test/clustertablestest/tables_test.go @@ -1228,7 +1228,7 @@ func TestTiDBTrx(t *testing.T) { // `WAITING_START_TIME` will not be affected by time_zone, it is in memory and we assume that the system time zone will not change. blockTime2.Format(types.TimeFSPFormat)+ " 0 19 10 user1 db1 [\"sql1\",\"sql2\",\""+digest.String()+"\"] ")) - tk.MustQuery(`select state from information_schema.tidb_trx as trx union select state from information_schema.tidb_trx as trx`). + tk.MustQuery(`select state from information_schema.tidb_trx as trx union select state from information_schema.tidb_trx as trx`).Sort(). Check(testkit.Rows(txninfo.TxnRunningStateStrs[txninfo.TxnLockAcquiring], txninfo.TxnRunningStateStrs[txninfo.TxnIdle])) rows := tk.MustQuery(`select WAITING_TIME from information_schema.TIDB_TRX where WAITING_TIME is not null`) From 375ef78eaeef78a47714a61d3dbe352038fb69fc Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Tue, 11 Jun 2024 17:49:08 +0800 Subject: [PATCH 2/2] * Signed-off-by: Weizhen Wang --- pkg/infoschema/test/clustertablestest/tables_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/infoschema/test/clustertablestest/tables_test.go b/pkg/infoschema/test/clustertablestest/tables_test.go index 7b7b769c857b7..29bb21ebbfb2a 100644 --- a/pkg/infoschema/test/clustertablestest/tables_test.go +++ b/pkg/infoschema/test/clustertablestest/tables_test.go @@ -1229,7 +1229,7 @@ func TestTiDBTrx(t *testing.T) { blockTime2.Format(types.TimeFSPFormat)+ " 0 19 10 user1 db1 [\"sql1\",\"sql2\",\""+digest.String()+"\"] ")) tk.MustQuery(`select state from information_schema.tidb_trx as trx union select state from information_schema.tidb_trx as trx`).Sort(). - Check(testkit.Rows(txninfo.TxnRunningStateStrs[txninfo.TxnLockAcquiring], txninfo.TxnRunningStateStrs[txninfo.TxnIdle])) + Check(testkit.Rows(txninfo.TxnRunningStateStrs[txninfo.TxnIdle], txninfo.TxnRunningStateStrs[txninfo.TxnLockAcquiring])) rows := tk.MustQuery(`select WAITING_TIME from information_schema.TIDB_TRX where WAITING_TIME is not null`) require.Len(t, rows.Rows(), 1)