Repository navigation
Keep the browser profile out of the scenario directory in the automation tests (#642) - #643
Merged
Merged
Conversation
…ion tests (#642) The profile of automation_host lived under the scenario's temporary directory. A browser helper that survives the host (the watchdog ends it with _Exit(72)) could write into it between the walk of the directory and its removal, and the strict cleanup failed with ENOTEMPTY. Host now places the XDG and CEF profiles in its private profile directory, whose removal is repeated until the helper is gone (remove_profile). The scenario's own cleanup stays strict. AutomationProfileCleanup covers a late write deterministically.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…profile paths (#642) shutil.rmtree can raise FileNotFoundError for a file that a browser helper removed during the walk while the root remains: remove_profile now ends only when the root is gone and retries otherwise. The isolation test instantiates Host with a mocked Popen and checks that XDG_DATA_HOME, XDG_CACHE_HOME and WEBFRONT_TEST_CEF_PROFILE are outside the scenario directory, so it fails with the former layout.
AM-L
approved these changes
Nov 22, 2026
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.
Fixes #642.
Problem
AutomationMcpWatchdogfailed on the Linux WebKitGTK job withOSError: [Errno 39] Directory not emptywhen the scenario'sTemporaryDirectorywas removed. Since #636Hostput the XDG and CEF profiles under that directory, and a browser helper that outlivesautomation_host(the watchdog ends it with_Exit(72)) can still write into its profile between the walk of the directory and its removal.Change
Hostplaces the XDG and CEF profiles in its privateprofile_directory(), outside the scenario directory. The scenario's cleanup stays strict, and the checks on the MCP listener, the discovery record and the private directory are unchanged.remove_profile()repeats the removal until the helper is gone and leaves what it still holds to the system's temporary directory.AutomationProfileCleanuptest (fast): a late write during removal is retried and the profile is finally removed; the profile is outside the scenario directory.Validation
Build
build-632-cef(CEF):AutomationProfileCleanuppasses,AutomationMcpWatchdogpasses 7 times in a row, and all 19Automation*tests pass.Not run locally: the WebKitGTK/Xvfb job, where the failure was observed, and the complete standard suite. The CI logs do not identify which process wrote, so this makes the cleanup tolerant rather than naming the helper.