Repository navigation
Automation: the host recognises a revocation by a deadline, so a window closed after it exits with 71 (#709) - #710
Conversation
…st exits with 71 (#709) Session::expire and expireStartup close the session with their own reason, which the supervisor's later close could not replace: automation_host compared the failure with a reason no deadline ever wrote, and a window that closed after the deadline exited with 0. The session now records which deadline revoked it (revokedBy(), and revocation in webfront.session), the host reads that state, and AutomationMcpWatchdog first runs an operation that never completes in a responsive renderer, whose window closes after the deadline: status 71, deterministically.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Closes #709.
What changes
Automation (
include/webfront/automation/Session.hpp,Enable.hpp)Session::revokedBy()returnsoperation-deadlineorstartup-deadline(Session::operationDeadline,Session::startupDeadline), empty when the session is open or closed for another reason.describe(), hence thewebfront.sessiontool, gives it asrevocation. The first closing fixes it, like the failure reason.session->close("Native automation deadline exceeded")after an expiry:expireandexpireStartupalready closed the session with their own reason, so that call had no effect, and its reason was never the one the session kept.Test host (
test/web/AutomationHost.cpp)automation_hostexits with 71 whenrevokedBy()names a deadline, and writesAutomation <deadline>: <reason>on stderr. Before, it compared the failure with "Native automation deadline exceeded", which no deadline ever wrote: a window that closed after the deadline exited with 0, andAutomationMcpWatchdogpassed only when the renderer kept the window open (72). A startup deadline now also exits with 71 instead of 70, as the issue asks.Documentation:
docs/AUTOMATION.md(therevocationmember ofwebfront.session, the new case ofAutomationMcpWatchdog) anddocs/CHANGELOG.md(Fixed).Tests
test/unit/AutomationTests.cpp): an expired operation givesrevokedBy() == operation-deadlineand the samerevocationindescribe(), and a laterclose("Native automation deadline exceeded")keeps both the deadline and the first reason; an expired startup givesstartup-deadline; a session closed for another reason ("Developer window disconnected") names no deadline.AutomationMcpWatchdog(test/tools/AutomationClient.py) first runs an operation that never completes in a responsive renderer (await new Promise(() => {})): the deadline revokes the session, the page runs the request to close,show()returns, and the host must exit with exactly 71 and logAutomation operation-deadline: Native operation deadline exceeded. This is the case of the issue (window closed after the deadline), now deterministic. The blocked-renderer case still accepts 71 or 72. The two archives are built by one helper (operation_archive).AssertionError: exit 0, the symptom of the issue.AutomationMcpWatchdogandAutomationMcpWindowpass.