mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
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.
This commit is contained in:
parent
2c1148e3b5
commit
46faf0869c
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user