From 2d29f5ac7d8fcc50c4ce2d2b9f8906943b87e30d Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 17 Dec 2024 17:48:33 +0800 Subject: [PATCH] enh/TD-29974-improve-trans-fix-case --- .../0-others/show_transaction_detail.py | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/tests/system-test/0-others/show_transaction_detail.py b/tests/system-test/0-others/show_transaction_detail.py index fda1eaacb9..13ef8f6316 100644 --- a/tests/system-test/0-others/show_transaction_detail.py +++ b/tests/system-test/0-others/show_transaction_detail.py @@ -47,28 +47,32 @@ class TDTestCase: t1.start() t2.start() - dnode = self.dnodes[1] + #time.sleep(1) + + dnode = self.dnodes[2] # stop dnode - tdLog.info(f"stop dnode 1") + tdLog.info(f"stop dnode 2") dnode.stoptaosd() - rows = tdSql.query("show transactions;") + tdLog.info(f"show transactions;") + rows = tdSql.query("show transactions;", queryTimes=1) + tdLog.info(f"rows={rows}") if rows > 0: - tranId = tdSql.getData(0, 0) - tdLog.info(f"show transaction {tranId}") - rows = tdSql.query(f"show transaction {tranId}", queryTimes=1) + tranId1 = tdSql.getData(0, 0) + oper1 = tdSql.getData(0, 3) + tdLog.info(f"show transaction {tranId1}, {oper1}") + tranId2 = tdSql.getData(1, 0) + oper2 = tdSql.getData(1, 3) + tdLog.info(f"show transaction {tranId2}, {oper2}") + + rows = tdSql.query(f"show transaction {tranId1}", queryTimes=1) if rows != 160 and rows != 176: tdLog.exit(f"restore transaction detial error, rows={rows}") return False - rows = tdSql.query("show transactions;") - if rows > 0: - tranId = tdSql.getData(1, 0) - tdLog.info(f"show transaction {tranId}") - rows = tdSql.query(f"show transaction {tranId}", queryTimes=1) - + rows = tdSql.query(f"show transaction {tranId2}", queryTimes=1) if rows != 176 and rows != 160: tdLog.exit(f"restore transaction detial error, rows={rows}") return False @@ -81,12 +85,12 @@ class TDTestCase: return False def createDbThread(self, sql, newTdSql): - tdLog.info("CREATE DATABASE db2 vgroups 160 replica 1;") - newTdSql.execute('CREATE DATABASE db2 vgroups 160 replica 1;') + tdLog.info("CREATE DATABASE db2 vgroups 160 replica 3;") + newTdSql.execute('CREATE DATABASE db2 vgroups 160 replica 3;', queryTimes=1) def alterDbThread(self, sql, newTdSql): tdLog.info("alter DATABASE db1 replica 3;") - newTdSql.execute('alter DATABASE db1 replica 3;') + newTdSql.execute('alter DATABASE db1 replica 3;', queryTimes=1) def waitTransactionZero(self, seconds = 300, interval = 1): # wait end