Skip to content

Keep the browser profile out of the scenario directory in the automation tests (#642) - #643

Merged
AM-L merged 2 commits into
developfrom
642-automation-profile-cleanup
Nov 22, 2026
Merged

AM-L merged 2 commits into
developfrom
642-automation-profile-cleanup

Conversation

@ambroise-leclerc

Copy link
Copy Markdown
Collaborator

Fixes #642.

Problem

AutomationMcpWatchdog failed on the Linux WebKitGTK job with OSError: [Errno 39] Directory not empty when the scenario's TemporaryDirectory was removed. Since #636 Host put the XDG and CEF profiles under that directory, and a browser helper that outlives automation_host (the watchdog ends it with _Exit(72)) can still write into its profile between the walk of the directory and its removal.

Change

  • Host places the XDG and CEF profiles in its private profile_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.
  • New AutomationProfileCleanup test (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): AutomationProfileCleanup passes, AutomationMcpWatchdog passes 7 times in a row, and all 19 Automation* 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.

…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.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3366dff1-44e2-470a-a57e-c62a43e84bf6
Commits

Reviewing files that changed from the base of the PR and between 31e954b and 3d1db6a.

Files selected for processing: 3

  • test/tools/AutomationClient.py
  • test/tools/ProfileCleanupTest.py
  • test/web/CMakeLists.txt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

…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
AM-L merged commit f452dc5 into develop Nov 22, 2026
13 checks passed
@AM-L
AM-L deleted the 642-automation-profile-cleanup branch November 22, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux CI : course au nettoyage du profil navigateur dans AutomationMcpWatchdog

2 participants