From 659abc1dc426c9af37cb73d52d45f2efa97f8fe6 Mon Sep 17 00:00:00 2001 From: dmchen Date: Mon, 11 Nov 2024 10:41:56 +0800 Subject: [PATCH] fix/TS-5251-add-conflict-check-fix-case --- tests/army/cluster/compactDBConflict.py | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/army/cluster/compactDBConflict.py b/tests/army/cluster/compactDBConflict.py index c2ce8f1d96..0645fcd8e1 100644 --- a/tests/army/cluster/compactDBConflict.py +++ b/tests/army/cluster/compactDBConflict.py @@ -60,26 +60,26 @@ class TDTestCase(TBase): tdSql.execute('use db') - event0 = threading.Event() - t0 = threading.Thread(target=self.compactDBThread, args=(event0)) + event = threading.Event() + t0 = threading.Thread(target=self.compactDBThread, args=('', event)) t0.start() - tdLog.debug("threading started!!!!!") - event0.wait() + tdLog.debug("t0 threading started!!!!!") + event.wait() tdSql.error('ALTER DATABASE db REPLICA 3;', expectErrInfo="Transaction not completed due to conflict with compact") t0.join() event1 = threading.Event() - t1 = threading.Thread(target=self.compactDBThread, args=(event1)) + t1 = threading.Thread(target=self.compactDBThread, args=('', event1)) t1.start() - tdLog.debug("threading started!!!!!") + tdLog.debug("t1 threading started!!!!!") event1.wait() tdSql.error('REDISTRIBUTE VGROUP 5 DNODE 1;', expectErrInfo="Transaction not completed due to conflict with compact") t1.join() event2 = threading.Event() - t2 = threading.Thread(target=self.compactDBThread, args=(event2)) + t2 = threading.Thread(target=self.compactDBThread, args=('', event2)) t2.start() - tdLog.debug("threading started!!!!!") + tdLog.debug("t2 threading started!!!!!") event2.wait() rowLen = tdSql.query('show vgroups') if rowLen > 0: @@ -89,43 +89,43 @@ class TDTestCase(TBase): t2.join() event3 = threading.Event() - t3 = threading.Thread(target=self.compactDBThread, args=(event3)) + t3 = threading.Thread(target=self.compactDBThread, args=('', event3)) t3.start() - tdLog.debug("threading started!!!!!") + tdLog.debug("t3 threading started!!!!!") event3.wait() tdSql.error('BALANCE VGROUP;', expectErrInfo="Transaction not completed due to conflict with compact") t3.join() t4 = threading.Thread(target=self.splitVgroupThread) t4.start() - tdLog.debug("threading started!!!!!") + tdLog.debug("t4 threading started!!!!!") time.sleep(1) tdSql.error('compact database db;', expectErrInfo="Conflict transaction not completed") t4.join() t5 = threading.Thread(target=self.RedistributeVGroups) t5.start() - tdLog.debug("threading started!!!!!") + tdLog.debug("t5 threading started!!!!!") time.sleep(1) tdSql.error('compact database db;', expectErrInfo="Conflict transaction not completed") t5.join() t6 = threading.Thread(target=self.balanceVGROUPThread) t6.start() - tdLog.debug("threading started!!!!!") + tdLog.debug("t6 threading started!!!!!") time.sleep(1) tdSql.error('compact database db;', expectErrInfo="Conflict transaction not completed") t6.join() t7 = threading.Thread(target=self.alterDBThread) t7.start() - tdLog.debug("threading started!!!!!") + tdLog.debug("t7 threading started!!!!!") time.sleep(1) tdSql.error('compact database db;', expectErrInfo="Conflict transaction not completed") t7.join() - def compactDBThread(self, event): + def compactDBThread(self, p, event): tdLog.info("compact db start") tdSql.execute('compact DATABASE db') event.set()