From 269b18532df93b21882a0ccf0a296cdd5101bd03 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 5 May 2024 14:51:03 -0700 Subject: [PATCH] Fix Ctrl-C signals test Prior to this change, signals.py attempted to generate Ctrl-C (SIGINT) by sending \x03 to stdin. But with the change to use the CSI U sequence, Ctrl-C no longer generates SIGINT. Switch to sending SIGINT directly. Also switch up some of the sleep constants so that a sleep command can't be confused with another one. --- tests/pexpects/signals.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/pexpects/signals.py b/tests/pexpects/signals.py index 6e0bdf0ce..6d0ed8914 100644 --- a/tests/pexpects/signals.py +++ b/tests/pexpects/signals.py @@ -28,18 +28,18 @@ expect_prompt() # Verify that SIGINT inside a command sub cancels it. # Negate the pid to send to the pgroup (which should include sleep). -sendline("while true; echo (sleep 1000); end") +sendline("while true; echo (sleep 2000); end") sleep(0.5) os.kill(-sp.spawn.pid, signal.SIGINT) expect_prompt() -sendline("sleep 10 &") +# SIGINT should be ignored by background processes. +sendline("sleep 1234 &") expect_prompt() - -send("\x03") +os.kill(-sp.spawn.pid, signal.SIGINT) sleep(0.010) sendline("jobs") -expect_prompt("sleep.10") +expect_prompt("sleep 1234") sendline("kill %1") expect_prompt()