fix/TS-5251-add-conflict-check-fix-case
This commit is contained in:
parent
d9ff557600
commit
659abc1dc4
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue