Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b557222fc607b714b5d3645ac98d05ef00846642
https://github.com/WebKit/WebKit/commit/b557222fc607b714b5d3645ac98d05ef00846642
Author: Yijia Huang <[email protected]>
Date: 2026-04-20 (Mon, 20 Apr 2026)
Changed paths:
M JSTests/wasm/debugger/lib/__init__.py
R JSTests/wasm/debugger/lib/core/__init__.py
R JSTests/wasm/debugger/lib/core/base.py
R JSTests/wasm/debugger/lib/core/environment.py
R JSTests/wasm/debugger/lib/core/registry.py
R JSTests/wasm/debugger/lib/core/utils.py
R JSTests/wasm/debugger/lib/discovery/__init__.py
R JSTests/wasm/debugger/lib/discovery/auto_discovery.py
A JSTests/wasm/debugger/lib/environment.py
R JSTests/wasm/debugger/lib/runners/__init__.py
R JSTests/wasm/debugger/lib/runners/parallel.py
R JSTests/wasm/debugger/lib/runners/process_manager.py
R JSTests/wasm/debugger/lib/runners/sequential.py
A JSTests/wasm/debugger/lib/session.py
A JSTests/wasm/debugger/lib/utils.py
M JSTests/wasm/debugger/resources/c-wasm/add/main.js
M JSTests/wasm/debugger/resources/swift-wasm/crash-test/main.js
M JSTests/wasm/debugger/resources/swift-wasm/do-catch-throw/main.js
M JSTests/wasm/debugger/resources/swift-wasm/dynamic-module-load/main.js
M JSTests/wasm/debugger/resources/swift-wasm/fatal-error-test/main.js
M JSTests/wasm/debugger/resources/swift-wasm/globals-test/main.js
M JSTests/wasm/debugger/resources/swift-wasm/test/main.js
M JSTests/wasm/debugger/resources/wasm/call-indirect.js
M JSTests/wasm/debugger/resources/wasm/call-ref.js
M JSTests/wasm/debugger/resources/wasm/call.js
M JSTests/wasm/debugger/resources/wasm/delegate.js
M JSTests/wasm/debugger/resources/wasm/dynamic-module-load.js
M JSTests/wasm/debugger/resources/wasm/js-js-wasm-js-js-wasm.js
M JSTests/wasm/debugger/resources/wasm/js-wasm-js-wasm.js
M
JSTests/wasm/debugger/resources/wasm/multi-vm-same-module-different-funcs.js
M JSTests/wasm/debugger/resources/wasm/multi-vm-same-module-same-func.js
M JSTests/wasm/debugger/resources/wasm/named-streaming-module.js
M JSTests/wasm/debugger/resources/wasm/nop-drop-select-end.js
M JSTests/wasm/debugger/resources/wasm/rethrow.js
M JSTests/wasm/debugger/resources/wasm/return-call-indirect.js
M JSTests/wasm/debugger/resources/wasm/return-call-ref.js
M JSTests/wasm/debugger/resources/wasm/return-call.js
M JSTests/wasm/debugger/resources/wasm/streaming-module-load.js
M JSTests/wasm/debugger/resources/wasm/system-call.js
M JSTests/wasm/debugger/resources/wasm/throw-catch-all.js
M JSTests/wasm/debugger/resources/wasm/throw-catch.js
M JSTests/wasm/debugger/resources/wasm/throw-ref.js
M JSTests/wasm/debugger/resources/wasm/trap-div-by-zero.js
M JSTests/wasm/debugger/resources/wasm/trap-oob-memory.js
M JSTests/wasm/debugger/resources/wasm/trap-out-of-bounds-call-indirect.js
M JSTests/wasm/debugger/resources/wasm/trap-stack-overflow.js
M JSTests/wasm/debugger/resources/wasm/try-table.js
M JSTests/wasm/debugger/resources/wasm/unreachable.js
M JSTests/wasm/debugger/resources/wasm/url-named-streaming-module.js
M JSTests/wasm/debugger/resources/wasm/wasm-js-wasm-js-wasm.js
M JSTests/wasm/debugger/resources/wasm/wasm-wasm-js-wasm-wasm.js
M JSTests/wasm/debugger/resources/wasm/wasm-wasm-wasm.js
M JSTests/wasm/debugger/test-wasm-debugger.py
M JSTests/wasm/debugger/tests/__init__.py
M JSTests/wasm/debugger/tests/jsc.py
M JSTests/wasm/debugger/tests/tests.py
Log Message:
-----------
[JSC][WASM][Debugger] Simplify debugger test infrastructure
https://bugs.webkit.org/show_bug.cgi?id=312735
rdar://175132771
Reviewed by Mark Lam.
Replace the old framework (BaseTestCase, registry, auto-discovery, runner
classes, OutputInterceptor) with a minimal DebugSession class that owns
one JSC + LLDB pair per test, plus slim utils/environment modules.
1. Infrastructure simplification
The old framework wrapped a for-loop and ThreadPoolExecutor in layers of
registry/runner scaffolding. The per-call worker thread shared a
_stop_monitoring Event that was set then cleared between calls — a race
if the previous worker hadn't exited yet. DebugSession uses 4 permanent
daemon reader threads (one per stream), a queue.Queue per session, and a
synchronous _wait() in the calling thread. Parallel tests get isolated
sessions with isolated queues; zero shared state.
2. DEBUGGER_READY handshake
Previously LLDB connected immediately after JSC started, racing with WASM
module loads that produced spurious stop notifications polluting the test
command flow. JS test files now print "DEBUGGER_READY" after all modules
are loaded; DebugSession blocks on that signal before spawning LLDB, so
no module-load events appear in the queue before the first cmd().
3. Remove "process interrupt" usage
The test infrastructure drives LLDB by matching output patterns as feedback
that a command took effect. For "process interrupt" this model breaks:
"Process 1 resuming" — the pattern matched after "c" — is printed early in
the resume path (CommandObjectProcess.cpp) before m_public_state has
transitioned to eStateRunning. m_public_state is only updated asynchronously
via ProcessEventData::DoOnRemoval() when the resume event is pulled off the
public queue. When "process interrupt" arrives immediately after, Halt()
checks GetPublicState(), still sees eStateStopped, and returns "Process is
not running." without calling SendAsyncInterrupt() or sending \x03 to JSC.
Tests using interrupt/continue cycles were removed rather than worked
around;
that coverage is provided by the C-level stress tests in
testwasmdebugger.cpp. cmd() now raises NotImplementedError if called with
that command to prevent future misuse.
4. Tighten pattern matching in test cases
_wait() exits as soon as all patterns are matched, leaving subsequent
output in the queue where it can satisfy the next cmd()'s patterns and
produce a false pass. Affected test cases were updated to require
stricter multi-pattern waits that cannot be satisfied by leftover lines
from the previous command.
Canonical link: https://commits.webkit.org/311618@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications