Class: Capybara::Lightpanda::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/lightpanda/process.rb

Constant Summary collapse

READY_PATTERN =
/server running.*address\s*=\s*(\d+\.\d+\.\d+\.\d+:\d+)/m
ADDRESS_IN_USE_PATTERN =
/err=AddressInUse/
STOP_GRACE_SECONDS =

Seconds to wait for a graceful SIGTERM before escalating to SIGKILL in stop / the GC finalizer. Lightpanda absorbs a single SIGTERM while a CDP connection is still live (graceful shutdown blocks on the connection worker — see .claude/rules/lightpanda-io.md limitation #7B). The PRIMARY fix is gem-side: Browser closes the CDP WebSocket before SIGTERM at exit (Browser.quit_all via at_exit), so SIGTERM lands after EOF and teardown is instant. This escalation is the BACKSTOP for crash / GC-abandon paths the at_exit can't reach — without it, a SIGTERM left to the finalizer (which can't close the WS) blocked Process.wait forever (the 45-min rake test:all hang). NOT the same as #2507/#2509 (telemetry curl-multi), which the gem never hits because it disables telemetry.

3
MINIMUM_NIGHTLY_BUILD =

Floor for the cookie/navigation/redirect/modal/keyboard/css/forms/dispatch/ xpath/history/iframe-context/dialog fixes the gem now relies on: PR #2255 (Network.clearBrowserCookies empty params + Network.getAllCookies), PR #2257 (window.location.pathname/.search assignment triggers navigation), PR #2265 (URL fragment inherited across fragment-less redirect), PR #2261 (LP.handleJavaScriptDialog pre-arm), PR #2283 (Referer on cross-page nav), PR #2292 (KeyboardEvent.keyCode/charCode), PR #2294 (UA stylesheet display:none for HEAD/SCRIPT/STYLE/NOSCRIPT/TEMPLATE/ TITLE/[type=hidden]), PR #2308 (textarea LF→CRLF), PR #2312 ( click submits form), PR #2315 (:disabled honors fieldset/ optgroup ancestors), PR #2322 (LP dialog defaultText fallback when promptText is null), PR #2324 (

click toggles parent
.open), PR #2352 (HTMLInputElement.pattern + patternMismatch via V8 RegExp), PR #2368 (events: report listener exceptions instead of halting dispatch — load-bearing for the gem's JS bundle dispatch assumptions), PR #2289 (Page.getNavigationHistory + Page.navigateToHistoryEntry — lets us drop the history.back()/history.forward() JS workaround in Browser#back / #forward), PR #2305 (XPath 1.0: Document.evaluate, XPathResult, XPathEvaluator, XPathExpression — lets us drop the ~700 LOC XPath polyfill in javascripts/index.js), PR #2431 (cdp: remove duplicate Page.frameNavigated emission + reuse child frame's V8 context — fixes issue #2400 iframe contextId churn, lets us drop Browser#find_in_frame's refresh_frame_stack! rescue), PR #2445 (cdp: reset browser context arena on Target.disposeBrowserContext — restores per-spec state hygiene during Driver#reset!, cures the batch-mode pollution that PR #2431 alone exposed), PR #2435 (dom: implement HTMLDialogElement.showModal, close natively — load-bearing for the gem's HTMLDialogElement assumptions after polyfills.js was deleted), PR #2450 (forms: add enctype + 5 submitter form-* IDL accessors + text/plain submission — lets us delete polyfills.js entirely; reads of form.enctype / submitter.formTarget now return spec-typed values natively), PR #2478 (css: evaluate @media and matchMedia against viewport — inline