Repository navigation
fix(ci): prevent macOS 26 streaming runner hangs - #3643
Conversation
Wait for the complete Ninja build before launching dynamic-library runners, honor NO_PARALLEL, and add phase-boundary regressions. Also repair two current-master lint/test expectations encountered by the required gates. Closes #3642
📝 WalkthroughWalkthroughThe streaming runner now completes compilation and DLL stabilization before running tests, uses project-controlled worker counts, and adds coordination regressions. Watchdog cleanup handles interrupts explicitly, documentation reflects the new flow, and AutoResearch filter expectations are updated. ChangesStreaming execution coordination
Watchdog interrupt cleanup
AutoResearch filter expectations
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
ci/tests/test_sketch_filter.py (1)
738-750: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExercise the newly added LPC boards through the compile-path test.
The parsing assertion now includes
lpc845,lpc845brk,lpcxpresso845max, andlpcxpresso804, buttest_autoresearch_supported_boards_compilestill tests only the original five boards. Add the four LPC boards to that parametrization so filtering and board compatibility are verified end to end.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci/tests/test_sketch_filter.py` around lines 738 - 750, Update the board parametrization for test_autoresearch_supported_boards_compile to include lpc845, lpc845brk, lpcxpresso845max, and lpcxpresso804 alongside the existing boards, ensuring the newly parsed LPC boards are covered by the compile-path test.ci/tests/test_streaming_runner_artifact_validation.py (1)
123-184: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOrdering assertions are sound, but the simulated
on_test_compiledcallback is dead code.
stream_compile_only's real signature (ci/meson/streaming.py) no longer accepts anon_test_compiledkwarg — that callback path was removed as part of this PR.fake_compile_only'skwargs.get("on_test_compiled")therefore always resolves toNonein both tests here, so the "pre-link callback fires early" simulation never actually runs. The tests still correctly validate the real invariant (execution deferred untilstream_compile_onlyreturns, and suppressed on failure) viacompile_finished/early-return, so this doesn't weaken the regression — it's just vestigial from the prior callback-based design and slightly overstates what's being simulated.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci/tests/test_streaming_runner_artifact_validation.py` around lines 123 - 184, Remove the obsolete on_test_compiled callback simulation from fake_compile_only in test_test_starts_after_compile_completes and test_failed_compile_runs_no_tests. Keep the compile_finished tracking, CompileOnlyResult returns, and existing assertions so the tests continue validating deferred execution and suppression after failed compilation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ci/meson/streaming.py`:
- Around line 522-529: Bound the wait loop in stream_compile_only around
dll_touch_done so it has an overall deadline instead of waiting indefinitely.
Keep the short timed waits for Ctrl+C responsiveness, and fail fast with an
appropriate error when _touch_dlls_bg() does not signal completion before the
deadline.
---
Nitpick comments:
In `@ci/tests/test_sketch_filter.py`:
- Around line 738-750: Update the board parametrization for
test_autoresearch_supported_boards_compile to include lpc845, lpc845brk,
lpcxpresso845max, and lpcxpresso804 alongside the existing boards, ensuring the
newly parsed LPC boards are covered by the compile-path test.
In `@ci/tests/test_streaming_runner_artifact_validation.py`:
- Around line 123-184: Remove the obsolete on_test_compiled callback simulation
from fake_compile_only in test_test_starts_after_compile_completes and
test_failed_compile_runs_no_tests. Keep the compile_finished tracking,
CompileOnlyResult returns, and existing assertions so the tests continue
validating deferred execution and suppression after failed compilation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 707cf992-1165-4f7d-9332-226bd98d59b7
📒 Files selected for processing (6)
ci/autoresearch/phases.pyci/meson/README.mdci/meson/streaming.pyci/meson/streaming_runner.pyci/tests/test_sketch_filter.pyci/tests/test_streaming_runner_artifact_validation.py
| # The build optimizer may still be touching DLL mtimes after Ninja exits. | ||
| # Wait before stabilization and before returning artifacts to the caller; | ||
| # loading a DLL concurrently with os.utime() fails intermittently on | ||
| # Windows and can race the macOS dynamic loader. | ||
| # Poll so Ctrl+C remains responsive if the optimizer thread stalls. | ||
| while not dll_touch_done.wait(timeout=0.2): | ||
| pass | ||
|
|
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the file and locate relevant symbols
ast-grep outline ci/meson/streaming.py --view expanded
# Find the wait loop and related event/thread handling
rg -n "dll_touch_done|_touch_dlls_bg|compile_timeout|RunningProcess|stream_compile_only|touch_dll" ci/meson/streaming.py
# Read the surrounding section around the wait loop
sed -n '460,560p' ci/meson/streaming.py
# Read the thread function and any finally/set paths
sed -n '1,220p' ci/meson/streaming.pyRepository: FastLED/FastLED
Length of output: 14019
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the DLL touch thread and the end of producer_thread
sed -n '260,340p' ci/meson/streaming.py
sed -n '340,460p' ci/meson/streaming.py
# Inspect the exact wait-loop context with a bit more surrounding code
sed -n '510,540p' ci/meson/streaming.pyRepository: FastLED/FastLED
Length of output: 11739
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate the build optimizer implementation and the DLL touch helper
fd -a "build_optimizer.py" ci
fd -a "mtime_stabilizer.py" ci
rg -n "def touch_dlls_if_lib_unchanged|touch_dlls_if_lib_unchanged|timeout|wait\\(|sleep\\(" ci/meson/build_optimizer.py ci/meson/mtime_stabilizer.py
# Read the helper implementation
sed -n '1,260p' ci/meson/build_optimizer.py
sed -n '1,220p' ci/meson/mtime_stabilizer.pyRepository: FastLED/FastLED
Length of output: 11813
Bound the DLL-touch wait
_touch_dlls_bg() always sets dll_touch_done on exit, so the risk here is a hung filesystem operation, not a missed finally. This loop still has no overall deadline, which can block stream_compile_only() forever; add a timeout and fail fast if the optimizer never finishes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ci/meson/streaming.py` around lines 522 - 529, Bound the wait loop in
stream_compile_only around dll_touch_done so it has an overall deadline instead
of waiting indefinitely. Keep the short timed waits for Ctrl+C responsiveness,
and fail fast with an appropriate error when _touch_dlls_bg() does not signal
completion before the deadline.
Source: Coding guidelines
* fix(ci): bound DLL touch optimizer wait Fail the streaming build with a propagated diagnostic if DLL mtime optimization stalls. Add timeout coverage, exercise the newly supported LPC AutoResearch boards, and document the intentional pre-fix regression hook. Follow-up to #3643. * fix(ci): bound and diagnose Apple runner hangs * fix(ci): work around Apple ASan global deadlock * fix(ci): use Xcode sanitizer runtime on macOS * fix(ci): use Xcode toolchain for Apple sanitizers * fix(ci): provide macOS SDK to Xcode toolchain * fix(ci): disable unsupported Apple leak detection
Closes #3642
Root cause
Ninja emits its Linking target progress line before ld64/lld has finished writing the dynamic library. The streaming path treated that line as completion and launched the shared runner against a partially linked artifact; macOS 26 can hang in dlopen before the runner watchdog starts. The same path also bypassed NO_PARALLEL.
Resolution
Validation
Summary by CodeRabbit
New Features
Bug Fixes
Documentation