Skip to content

Commit 42a98f2

Browse files
committed
ui-tests: add ping interrupt test
The fixes of 7674c51 (Cygwin: console: Set ENABLE_PROCESSED_INPUT when disable_master_thread, 2025-07-01) were unfortunately not complete; There were still a couple of edge cases where Ctrl+C was unable to interrupt processes. Let's add a demonstration of that issue. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 1ae4f0c commit 42a98f2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ui-tests/ctrl-c.ahk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ Sleep 150
4141
; Wait for the `^C` tell-tale that is the PowerShell prompt to appear
4242
WaitForRegExInWindowsTerminal('>[ `n`r]*$', 'Timed out waiting for interrupt', 'Sleep was interrupted as desired')
4343

44+
; ping test (`cat.exe` should be interrupted, too)
45+
Send('git -c alias.c="{!}cat | /c/windows/system32/ping -t localhost" c{Enter}')
46+
Sleep 500
47+
WaitForRegExInWindowsTerminal('Pinging ', 'Timed out waiting for pinging to start', 'Pinging started')
48+
Send('^C') ; interrupt ping and cat
49+
Sleep 150
50+
; Wait for the `^C` tell-tale to appear
51+
WaitForRegExInWindowsTerminal('Control-C', 'Timed out waiting for pinging to be interrupted', 'Pinging was interrupted as desired')
52+
; Wait for the `^C` tell-tale that is the PowerShell prompt to appear
53+
WaitForRegExInWindowsTerminal('>[ `n`r]*$', 'Timed out waiting for `cat.exe` to be interrupted', '`cat.exe` was interrupted as desired')
54+
4455
; Clone via SSH test; Requires an OpenSSH for Windows `sshd.exe` whose directory needs to be specified via
4556
; the environment variable `OPENSSH_FOR_WINDOWS_DIRECTORY`. The clone will still be performed via Git's
4657
; included `ssh.exe`, to exercise the MSYS2 runtime (which these UI tests are all about).

0 commit comments

Comments
 (0)