mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
c8a2837647
This apparently doesn't work at all under Github Actions with tsan, so let's skip it. If anyone feels the need to dig deeper into this, have at it. I find this distracting.
38 lines
874 B
Python
38 lines
874 B
Python
#!/usr/bin/env python3
|
|
import os
|
|
from pexpect_helper import SpawnedProc
|
|
import signal
|
|
|
|
sp = SpawnedProc()
|
|
send, sendline, sleep, expect_str, expect_prompt = (
|
|
sp.send,
|
|
sp.sendline,
|
|
sp.sleep,
|
|
sp.expect_str,
|
|
sp.expect_prompt,
|
|
)
|
|
expect_prompt()
|
|
|
|
timeout = 0.15
|
|
|
|
if "CI" in os.environ:
|
|
# This doesn't work under tsan.
|
|
import sys
|
|
print("SKIPPING cancel_event.py")
|
|
sys.exit(0)
|
|
|
|
# Verify that cancel-commandline does what we expect - see #7384.
|
|
send("not executed")
|
|
sleep(timeout)
|
|
os.kill(sp.spawn.pid, signal.SIGINT)
|
|
sp.expect_str("not executed^C")
|
|
expect_prompt(increment=False)
|
|
|
|
sendline("function cancelhandler --on-event fish_cancel ; echo yay cancelled ; end")
|
|
expect_prompt()
|
|
send("still not executed")
|
|
sleep(timeout)
|
|
os.kill(sp.spawn.pid, signal.SIGINT)
|
|
expect_str("still not executed^C")
|
|
expect_prompt("yay cancelled", increment=False)
|