From ff9e4fb0081903171a5b375d38a3827dfdd9f186 Mon Sep 17 00:00:00 2001 From: actboy168 Date: Fri, 19 Apr 2024 21:20:40 +0800 Subject: [PATCH] improve test speed --- test/test_filewatch.lua | 5 +++-- test/test_subprocess.lua | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_filewatch.lua b/test/test_filewatch.lua index 51dab0ce..22e6a56d 100644 --- a/test/test_filewatch.lua +++ b/test/test_filewatch.lua @@ -50,12 +50,13 @@ function test_fw:test_2() end end end + local retry = 3 local list = {} - local n = 100 + local n = retry while true do local w, v = fw:select() if w then - n = 100 + n = retry if not has(list, v) and not equal(v, root:string()) then list[#list+1] = v end diff --git a/test/test_subprocess.lua b/test/test_subprocess.lua index b7b9d8c0..fcbdd7f8 100644 --- a/test/test_subprocess.lua +++ b/test/test_subprocess.lua @@ -91,7 +91,7 @@ function test_subprocess:test_is_running_2() lt.assertIsUserdata(process.stdin) process.stdin:close() while process:is_running() do - thread.sleep(1000) + thread.sleep(10) end lt.assertEquals(process:is_running(), false) safe_exit(process, 13)