Repository navigation
#3913: Full Suite Gate out of its timeout: small scans skip the worker pool, and Windows/macOS scans now match Linux - #3916
Merged
Conversation
A one-file scan took 3.5 s under fork but 9.4 s under spawn (Windows, macOS): every ProcessPoolExecutor worker re-imports GitGalaxy (~3 s) to extract files that take milliseconds, and galaxyscope always started cpu_count-1 of them. The Full Suite Gate's Windows jobs reached their 30-minute limit on ~150 such test scans (mainframe fixtures at 38-47 s each, the gauntlet oracle at 318 s). - galaxyscope: never more workers than files; a scan of <= 16 files, or with GALAXYSCOPE_MAX_WORKERS=1, runs the same worker code in-process through _InlineExecutor (copied arguments, root log level and SIGALRM handler restored, exceptions via Future, main thread only). 1-file spawn scan: 9.4 s -> 3.4 s. - tests/conftest.py: under xdist, GALAXYSCOPE_MAX_WORKERS=1 (xdist already fills the cores). - full-suite-gate.yml: timeout 30 -> 45 minutes, as headroom. - test_inline_extraction.py: in-process rows equal the pool's on a 21-file estate; the executor's isolation guarantees. Follow-up for the per-process import cost: #3914. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
Contributor
detector.py decided whether to record call qualifiers (#3329) with `invocation_pattern is p for p in QUALIFIED_CALLS_OUT_PATTERNS`. Under the `spawn` start method (Windows, macOS) a scan worker's rules arrive pickled, so the pattern is a new object, `is` never matched, and every spawned scan silently dropped calls_out_qualifiers -- Windows/macOS output differed from Linux's (and the golden masters, which only run on Linux). The Windows and macOS Full Suite jobs on this branch caught it through the pool-vs-inline equivalence test: 20 of 21 function rows differed. Now matched by the pattern's text. Forced spawn == fork == in-process on the test estate; new tests force a spawned pool on any OS and check a pickled rule is still recognised (both fail without the fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
…0.25 s of queue silence test_production_regex_redos_immunity called any 0.25 s gap in its status queue a hang. On a busy 4-core runner (8 spawned fuzzers importing the registry beside 3 other xdist workers) that gap happens by itself: it blamed a different innocent regex each run (dart::func_start on main's macOS, then cpp::func_start on this PR's ubuntu 3.10). The same rule passed having checked nothing when no worker had started within 0.25 s. - a regex is flagged once it has run HANG_SECONDS (10 s) over the payloads, checked every loop pass, not only on silence; - a compile error still reports DONE (it is not a hang); - the test fails when the fuzzer stalls or checks fewer regexes than it collected; - new test: the kill-switch still catches ^(a+)+$. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
…ying test_a_redirect_is_refused_so_the_key_is_not_forwarded's handler answered 302 without reading the POST body, then the server closed the socket. On Windows, closing a socket with unread data sends a reset, which can reach the client before the response: ConnectionAbortedError (WinError 10053) on this PR's windows-latest 3.12 job. Reading Content-Length bytes first makes the close orderly on every OS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3913. Follow-up for the per-process import cost: #3914.
What was wrong
The Full Suite Gate's Windows jobs had reached their 30-minute limit. On #3901's own run, Windows 3.9 finished in 29 min 58 s, and on main's run 36335845364 both Windows jobs were cancelled at 98%.
Almost none of that time was testing:
cpu_count - 1worker processes, whatever its file count.spawnstart method, which Windows and macOS use, each worker re-imports GitGalaxy. That takes about 3 s, mostly compiling the language registry.A one-file scan measured on Linux:
forkspawnThe extraction itself took 0.06 s.
Changes
galaxyscope: no pool for a small scan.GALAXYSCOPE_MAX_WORKERS=1, runs the same worker code in-process through_InlineExecutor.spawndrops from 9.4 s to 3.4 s.tests/conftest.py: under xdist,GALAXYSCOPE_MAX_WORKERS=1, because xdist already puts a test on every core.full-suite-gate.yml:timeout-minutes30 → 45, as headroom only.A real engine bug the new equivalence test found
detector.pydecided whether to record call qualifiers (#3329) withinvocation_pattern is p for p in QUALIFIED_CALLS_OUT_PATTERNS.ischeck never matched.calls_out_qualifiers. On the test estate, 20 of 21 function rows differed from Linux.spawnscan now equalsfork, which equals in-process, and a Linux test forces a spawned pool so this stays caught.Two timing-sensitive tests, root-caused
test_production_regex_redos_immunitycalled any 0.25 s gap in its status queue a hang.dart::func_starton main's macOS, thencpp::func_starthere.^(a+)+$.test_a_redirect_is_refused_so_the_key_is_not_forwardedanswered without reading the POST body.Measured (Full Suite Gate, job wall time)
The slowest job went from about 30 minutes to 16.5, so the 45-minute limit leaves room. Before this PR, the Windows 3.9
--durationslist was led by the gauntlet oracle test at 318 s and about 20 mainframe fixtures at 38–47 s each. Now no mainframe fixture exceeds 23 s on Windows. Locally (4-core Linux,-n auto) the suite runs in 256 s, where the pre-push gates took 919 s earlier today.Verification
Golden masters are byte-identical in both modes. I checked twice:
GALAXYSCOPE_MAX_WORKERS=1);audit_check.py: all clear.Full suite locally: 12,666 passed.
New tests (
tests/core_engine/test_inline_extraction.py):The spawn and pickling tests fail without the detector fix.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5