Repository navigation
fix(ci): stop the Dart suite racing the runtime's global panic hook - #413
Merged
Merged
Conversation
dart-test's macos-15-intel leg failed on "plugins reports an unknown method
as a KCL error rather than crashing": errMessage came back as an empty
EvaluationError while the real text ("invalid method: ... is not found") went
to stderr from the runtime's panic hook.
The plugin agent reports a missing method the way every other KCL failure is
reported — as a __kcl_PanicInfo__ object the runtime turns into a panic — and
that panic's payload is captured by a process-global std::panic hook that the
runtime installs and restores around every evaluation, recording into a
thread-local. `dart test` runs test files in parallel isolates sharing one
libkcl, so an overlapping evaluation restores the hook another thread is
running under; the panicking thread then reads an empty record and the KCL
error loses its message. Only the first panic on a thread shows it, which is
why the next plugin test passed.
Run the suite serially (~0.1s on this package) and document why in the README.
The upstream fix belongs in kcl-lang/kcl, where FastRunner::run should fall
back to the caught panic payload instead of unwrap_or_default().
Also drop the duplicated windows-latest matrix entry, which ran the Windows
leg twice.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
dart/dart_test.yaml,concurrency: 1) —dart testruns test files in parallel isolates that share onelibkcl, and overlapping evaluations clobber each other's panic hook, so a KCL error can come back with an empty messagedart/README.mdnext to the existing not-thread-safe notewindows-latestmatrix entry, which ran the Windows leg twiceThe failure
Run #39233061134,
Test on macos-15-intel:Why
A plugin method that was never registered is reported the way every other KCL failure is — as a
__kcl_PanicInfo__object the plugin agent returns, which the runtime turns into a Rust panic. The panic's payload is whaterrMessageis built from, and the runtime captures it with a process-globalstd::panichook that it takes, replaces and restores around every evaluation, recording into a thread-local.Two overlapping evaluations therefore race on that hook: one thread restores the hook another is running under, and the panicking thread reads back an empty record, so the error renders with no message. Only the first panic on a thread exposes it — which is why the very next plugin test (
reports a throwing method as a KCL error) passed.Reproduced locally against libkcl v0.13.2 with four isolates (one driving plugin errors with a distinct method name per round, three hammering ordinary evaluations): 2 of 3 runs hit the race, one of them byte-identical to the CI failure at round 0.
Serial execution costs ~0.1s on this package.
Note
This stops the flake but is not the real fix: the hook install/restore is not concurrency-safe in kcl-lang/kcl (
crates/runner/src/runner.rs), andFastRunner::runfalls back tounwrap_or_default()instead of the caught panic payload when the record comes back empty. That belongs upstream and needs a new libkcl to take effect here.Test plan
make testindart/— 141 tests pass--reporter=expandedoutput shows each file's results as one contiguous block, i.e. suites really are serial nowwindows-latestappears once🤖 Generated with Claude Code