From 53683446d65766073c365787fa68a10d58645ab5 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Tue, 9 Jun 2020 16:16:53 +0800 Subject: [PATCH] fix random-test delete datafiles bug. --- tests/pytest/random-test/random-test-multi-threading-3.py | 3 ++- tests/pytest/random-test/random-test-multi-threading.py | 2 +- tests/pytest/random-test/random-test.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/pytest/random-test/random-test-multi-threading-3.py b/tests/pytest/random-test/random-test-multi-threading-3.py index cab17c4c1a..91f35ea7a5 100644 --- a/tests/pytest/random-test/random-test-multi-threading-3.py +++ b/tests/pytest/random-test/random-test-multi-threading-3.py @@ -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() diff --git a/tests/pytest/random-test/random-test-multi-threading.py b/tests/pytest/random-test/random-test-multi-threading.py index 1d8a5c3c82..997001157e 100644 --- a/tests/pytest/random-test/random-test-multi-threading.py +++ b/tests/pytest/random-test/random-test-multi-threading.py @@ -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 = "" diff --git a/tests/pytest/random-test/random-test.py b/tests/pytest/random-test/random-test.py index 855cabdedd..9cfc24f404 100644 --- a/tests/pytest/random-test/random-test.py +++ b/tests/pytest/random-test/random-test.py @@ -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) -- GitLab