Merge pull request #2205 from taosdata/feature/sangshuduo/multi-thread-random-test

fix random-test delete datafiles bug.
This commit is contained in:
Shengliang Guan 2020-06-09 16:21:50 +08:00 committed by GitHub
commit 2f44b5cbb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -205,6 +205,7 @@ class Test (Thread):
global written
dnodesDir = tdDnodes.getDnodesRootDir()
tdDnodes.forcestop(1)
dataDir = dnodesDir + '/dnode1/data/*'
deleteCmd = 'rm -rf %s' % dataDir
os.system(deleteCmd)
@ -261,7 +262,7 @@ class Test (Thread):
while True:
self.queryEvent.wait()
tdLog.notice("third thread")
randQueryOp = random.randint(1, 9)
randQueryOp = random.randint(1, 2)
queryOp.get(randQueryOp, lambda: "ERROR")()
self.queryEvent.clear()
self.dbEvent.clear()

View File

@ -208,12 +208,12 @@ class Test (threading.Thread):
global written
dnodesDir = tdDnodes.getDnodesRootDir()
tdDnodes.forcestop(1)
dataDir = dnodesDir + '/dnode1/data/*'
deleteCmd = 'rm -rf %s' % dataDir
os.system(deleteCmd)
tdDnodes.start(1)
# tdLog.sleep(10)
tdSql.prepare()
last_tb = ""
last_stb = ""

View File

@ -166,7 +166,8 @@ class Test:
def delete_datafiles(self):
tdLog.info("delete_datafiles")
dnodesDir = tdDnodes.getDnodesRootDir()
dataDir = dnodesDir + '/dnode1/*'
tdDnodes.forcestop(1)
dataDir = dnodesDir + '/dnode1/data/*'
deleteCmd = 'rm -rf %s' % dataDir
os.system(deleteCmd)