Repository navigation
Description
Parent: github/accessibility-scanner#300
Goal
Prevent one unresponsive URL, plugin, or browser from consuming the entire Actions job. Enforce a bounded execution lifecycle, recover owned browser resources, and allow later URLs to be scanned safely.
Current behavior
The URL loop awaits each URL in sequence. findForUrl has no overall deadline covering browser startup, navigation, selector waits, scans, and cleanup. Custom plugins and screenshot capture also need bounded operation budgets; relying solely on a library timeout has not been sufficient to recover a hung run.
Scope
- Introduce a documented per-URL deadline with a sensible default and validated configuration, wired through the public action and
findaction. - Bound generic plugin invocation and screenshot capture within the URL budget so either operation cannot consume the whole run. Reuse a common deadline/cancellation mechanism; built-in reflow-specific cleanup belongs to its own task.
- Bound teardown as well as scanning. Use an execution/watchdog boundary that can actually recover a stuck page or browser; a
Promise.racethat leaves work running is not enough. - Terminate only resources owned by the affected scan when graceful disposal fails, prevent late work from changing results, and create a healthy browser/page for the next URL.
- Isolate navigation, selector, plugin, and other per-URL failures. Record the failed stage and retain results from completed work rather than abandoning all later URLs.
- If retries are used, keep their count and total execution time bounded.
Acceptance criteria
- Fault-injection tests cover never-returning plugin execution, screenshot capture, and browser/context cleanup, plus navigation and selector failures.
- The measured time to exit each hung operation/URL, including teardown, stays within a documented bound. Include a realistic stuck-browser/process case rather than testing only a cooperative rejected promise.
- A URL after the failed one is scanned with healthy resources; no owned browser processes, timers, or pending result mutations remain after recovery.
- Configuration and defaults are documented and invalid inputs produce clear errors.
- Healthy scans preserve existing finding behavior and do not incur an unconditional wait for the deadline.
Boundary and safe rollout
This task owns execution budgets, resource lifecycle, and continuation, not the reporting schema or filing decisions. Use the completion contract from github/accessibility-scanner#301, and coordinate the safe-filing integration with github/accessibility-scanner#304. Built-in reflow control flow is handled separately in github/accessibility-scanner#303.
Continuation may be exercised independently, but do not enable normal filing from a partially completed run until explicit scan outcomes and safe reconciliation are wired through. Before that integration is available, a timed-out run must remain visibly unsuccessful and must not supply a misleading empty-findings result to filing.
🤖 Assisted by Copilot
Activity