From 46faf0869c3c01434c3a398c150f669f2176b746 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 8 Aug 2020 15:46:14 +0200 Subject: [PATCH] tests: Stop sleeping before expect It's useless - `expect` has a timeout anyway, and it defaults to 5s, so these 0.5s sleeps just mean it'll always take at least 0.5s. Sometimes it is useful to let things settle before *sending* text, and it would be nice to be able to set the timeout for each expect separately, but just adding to the timeout isn't useful. --- tests/pexpects/job_summary.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/pexpects/job_summary.py b/tests/pexpects/job_summary.py index af62863b0..0443a7f3d 100644 --- a/tests/pexpects/job_summary.py +++ b/tests/pexpects/job_summary.py @@ -22,9 +22,7 @@ expect_prompt() # fish_job_summary is called when background job ends. sendline("sleep 0.5 &") -sleep(0.050) expect_prompt() -sleep(0.550) expect_re("[0-9]+:0:sleep 0.5 &:ENDED") sendline("") expect_prompt() @@ -32,10 +30,8 @@ expect_prompt() # fish_job_summary is called when background job is signalled. # cmd_line correctly prints only the actually backgrounded job. sendline("false; sleep 10 &; true") -sleep(0.100) expect_prompt() sendline("kill -TERM $last_pid") -sleep(0.100) expect_re("[0-9]+:0:sleep 10 &:SIGTERM:Polite quit request") sendline("") expect_prompt() @@ -45,5 +41,4 @@ expect_prompt() sendline("true | sleep 6") sleep(0.100) call(["pkill", "-KILL", "sleep", "-P", str(sp.spawn.pid)]) -sleep(0.100) expect_re("[0-9]+:1:true|sleep 6:SIGKILL:Forced quit:[0-9]+:sleep")