test: gate offline release journey deterministically
All checks were successful
CI / lint (pull_request) Successful in 1m54s
CI / build-release (pull_request) Successful in 5s
CI / browser-journey (pull_request) Successful in 56s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy 2026-08-15 13:46:28 +00:00
parent 3c5c58fc38
commit c86a63c54b
2 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ class FakeGiteaServer(ThreadingHTTPServer):
def __init__(self, address: tuple[str, int]):
super().__init__(address, FakeGiteaHandler)
self.created_issues: list[dict] = []
self.issue_creation_enabled = False
class FakeGiteaHandler(BaseHTTPRequestHandler):
@ -62,6 +63,9 @@ class FakeGiteaHandler(BaseHTTPRequestHandler):
if path != "/api/v1/repos/acme/mobile/issues":
self._json(404, {"message": "not found"})
return
if not self.server.issue_creation_enabled:
self._json(503, {"message": "release journey is still offline"})
return
self.server.created_issues.append(payload)
assignee = payload.get("assignee")
self._json(

View File

@ -219,6 +219,7 @@ def test_release_artifact_files_one_mobile_issue_exactly_once_after_offline_relo
browser_errors.clear() # Chromium reports expected network errors while the context is offline.
failed_responses.clear()
fake.issue_creation_enabled = True
context.set_offline(False)
page.evaluate("window.dispatchEvent(new Event('online'))")
for _ in range(80):