Windows: tests/run_all.py dies without a word, test_job_queue sends a Ctrl+C to its console #2303
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#2303
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On Windows,
tests/run_all.pydies part-way through without a word: no summary, no failure, no exit code. The shell orwindow it runs in goes with it. The cause is a Ctrl+C that
tests/test_job_queue.pysends to its own console.How it happens (main @
753fb5af)Environment.test_places_every_version_sharespatchescommon.WINDOWStoFalseto check the Linux paths, thencalls
procs.proc_start(os.getpid())(tests/test_job_queue.py:137, :147).WINDOWSoff,proc_starttries/proc, fails, and falls back toos.kill(pid, 0)(scripts/devtools/procs.py:76).
CTRL_C_EVENT:os.kill(pid, 0)callsGenerateConsoleCtrlEvent, which delivers a Ctrl+Cto every process attached to the console. That includes run_all.py, the shell that started it and any wrapper, so all
of them end at once.
To see it
python -I -B tests/run_all.py test_job_queuein a console: run_all.py and the shell running it end, with no summary.A run of the whole suite stops after a few hundred results, always when test_job_queue runs (this PC: 16 at once,
about 270 results in).
A Python started the normal way (sharing the console) that calls
os.kill(os.getpid(), 0)reaches its parent: theparent's SIGINT handler fires. Only the first process of a new console gets
OSError 87instead.Since
#1802 (
068fb8eb), which added the test. CI runs run_all.py on Linux only (and only by hand), so it never showed there.Fix
In
proc_start, never take theos.kill(pid, 0)fallback on Windows: check the real platform (os.name == "nt"),not
common.WINDOWS, which tests patch. A pull request with a test that fails on main follows.Possibly related, for context: