-
Notifications
You must be signed in to change notification settings - Fork 0
feat(browser): retain MV3 failure profile cleanup evidence #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
12
commits into
test/agent-task-failure-cleanup-evidence
Choose a base branch
from
test/mv3-failure-profile-cleanup-evidence
base: test/agent-task-failure-cleanup-evidence
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+194
−17
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7df0058
test(browser): require MV3 failure profile cleanup evidence
seonghobae 2301459
feat(browser): retain MV3 failure cleanup evidence
seonghobae 42af52f
docs: record MV3 failure cleanup evidence
seonghobae 60183b8
docs: inherit browser recovery release notes
seonghobae c5a91bc
chore(stack): sync current Agent Task cleanup prerequisite
seonghobae acfc1c8
test(browser): cover MV3 restart teardown timeout
seonghobae 493279e
fix(browser): retain MV3 teardown timeout evidence
seonghobae e15a436
docs(changelog): record MV3 teardown timeout resilience
seonghobae bc9b265
chore(stack): realign MV3 cleanup evidence on current parent
seonghobae 645a710
test(browser): reproduce surface-failure cleanup misclassification
seonghobae 4fc623e
fix(browser): preserve cleanup evidence on MV3 surface failure
seonghobae fbdf64f
Merge remote-tracking branch 'origin/test/agent-task-failure-cleanup-…
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| """Contract for MV3 restart-trial profile cleanup evidence on browser failure.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import pathlib | ||
| import runpy | ||
| import unittest | ||
|
|
||
| ROOT = pathlib.Path(__file__).resolve().parents[1] | ||
| RUNNER = ROOT / "scripts" / "ci" / "run_mv3_compatibility.py" | ||
|
|
||
|
|
||
| class Mv3FailureProfileCleanupContractTests(unittest.TestCase): | ||
| """Require failed extension-compatibility trials to retain teardown evidence.""" | ||
|
|
||
| def _namespace(self, name: str) -> dict[str, object]: | ||
| return runpy.run_path(str(RUNNER), run_name=name) | ||
|
|
||
| def test_failed_restart_pass_returns_profile_cleanup_evidence(self) -> None: | ||
| """A failed initial or restarted browser pass must retain profile cleanup proof.""" | ||
|
|
||
| namespace = self._namespace("mv3_failure_cleanup_behavior") | ||
| run_trial = namespace["_run_restart_trial"] | ||
|
|
||
| def fail_browser_pass(*_args: object, **_kwargs: object) -> dict[str, object]: | ||
| raise RuntimeError("synthetic MV3 browser failure") | ||
|
|
||
| run_trial.__globals__["_run_browser_pass"] = fail_browser_pass | ||
| result = run_trial( | ||
| pathlib.Path("controlled-chrome"), | ||
| pathlib.Path("controlled-chromedriver"), | ||
| "http://127.0.0.1/controlled-fixture", | ||
| 11, | ||
| ) | ||
|
|
||
| self.assertEqual(result["trial_number"], 11) | ||
| self.assertIs(result["passed"], False) | ||
| self.assertEqual(result["failure_type"], "RuntimeError") | ||
| self.assertIs(result["profile_cleaned"], True) | ||
| self.assertNotIn("synthetic MV3 browser failure", repr(result)) | ||
|
|
||
| def test_surface_failure_preserves_cleanup_and_surface_evidence(self) -> None: | ||
| """A compatibility regression must not be mislabeled as profile cleanup failure.""" | ||
|
|
||
| namespace = self._namespace("mv3_surface_failure_cleanup_behavior") | ||
| run_trial = namespace["_run_restart_trial"] | ||
| browser_pass_number = 0 | ||
|
|
||
| def browser_pass(*_args: object, **_kwargs: object) -> dict[str, object]: | ||
| nonlocal browser_pass_number | ||
| browser_pass_number += 1 | ||
| persisted = browser_pass_number == 2 | ||
| return { | ||
| "browser_version": "controlled-browser", | ||
| "worker_start_count": browser_pass_number, | ||
| "storage_persistence": "persisted" if persisted else "initialized", | ||
| "surfaces": { | ||
| "service-worker": True, | ||
| "real-browser-click": not persisted, | ||
| }, | ||
| } | ||
|
|
||
| run_trial.__globals__["_run_browser_pass"] = browser_pass | ||
| result = run_trial( | ||
| pathlib.Path("controlled-chrome"), | ||
| pathlib.Path("controlled-chromedriver"), | ||
| "http://127.0.0.1/controlled-fixture", | ||
| 12, | ||
| ) | ||
|
|
||
| self.assertEqual(result["trial_number"], 12) | ||
| self.assertIs(result["passed"], False) | ||
| self.assertEqual(result["failure_type"], "CompatibilitySurfaceFailure") | ||
| self.assertIs(result["profile_cleaned"], True) | ||
| self.assertIs(result["surfaces"]["real-browser-click"], False) | ||
|
|
||
| def test_acceptance_gate_requires_cleanup_evidence_for_every_mv3_trial(self) -> None: | ||
| """Failed MV3 trials must not be filtered out of the profile-cleanup gate.""" | ||
|
|
||
| runner = RUNNER.read_text(encoding="utf-8") | ||
| self.assertIn("mv3_profiles_cleaned = all(", runner) | ||
| self.assertIn('trial.get("profile_cleaned") is True', runner) | ||
| self.assertIn('"profiles_cleaned": mv3_profiles_cleaned', runner) | ||
| self.assertIn("Manifest V3 profile cleanup gate failed", runner) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| """Regression contract for MV3 restart teardown timeout cleanup evidence.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import pathlib | ||
| import runpy | ||
| import subprocess | ||
| import unittest | ||
|
|
||
| ROOT = pathlib.Path(__file__).resolve().parents[1] | ||
| RUNNER = ROOT / "scripts" / "ci" / "run_mv3_compatibility.py" | ||
|
|
||
|
|
||
| class Mv3RestartTimeoutCleanupContractTests(unittest.TestCase): | ||
| """Require reviewed ChromeDriver teardown timeouts to retain MV3 cleanup proof.""" | ||
|
|
||
| def test_teardown_timeout_returns_profile_cleanup_evidence(self) -> None: | ||
| """A bounded process teardown timeout must become failed-trial evidence.""" | ||
|
|
||
| namespace = runpy.run_path(str(RUNNER), run_name="mv3_restart_timeout_cleanup") | ||
| run_trial = namespace["_run_restart_trial"] | ||
|
|
||
| def timeout_browser_pass(*_args: object, **_kwargs: object) -> dict[str, object]: | ||
| raise subprocess.TimeoutExpired( | ||
| cmd="private-controlled-chromedriver-path", | ||
| timeout=5, | ||
| ) | ||
|
|
||
| run_trial.__globals__["_run_browser_pass"] = timeout_browser_pass | ||
| result = run_trial( | ||
| pathlib.Path("controlled-chrome"), | ||
| pathlib.Path("controlled-chromedriver"), | ||
| "http://127.0.0.1/controlled-fixture", | ||
| 12, | ||
| ) | ||
|
|
||
| self.assertEqual(result["trial_number"], 12) | ||
| self.assertIs(result["passed"], False) | ||
| self.assertEqual(result["failure_type"], "TimeoutExpired") | ||
| self.assertIs(result["profile_cleaned"], True) | ||
| self.assertNotIn("private-controlled-chromedriver-path", repr(result)) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.