Login retry after a 2FA timeout waits for the closed Chrome, then opens a new one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ManikandanandClaude Opus 5.5 committed 2026-10-27 19:18:55 +05:30
1 parent 64efb68ea1
commit a8af44e673
3 files changed
+60 -15

No files matched your search

+11 -1
View File
@@ -354,7 +354,17 @@ def _run_bot_starts_chrome() -> int:
page.set_content("<p>x</p>")
b.close()
if close_after:
assert _gone(url), "Chrome still answers"
# close() returns once Chrome is gone, not while it
# is still shutting down.
assert not browser.cdp_ready(url), \
"Chrome still answers after close()"
# A login retry (2FA timed out) launches again: a
# fresh Chrome, not the dying one (2026-10-27 16:50).
b, ctx, page = browser.launch(pw)
page.set_content("<p>again</p>")
b.close()
assert not browser.cdp_ready(url), \
"the reopened Chrome still answers"
else:
time.sleep(1)
assert browser.cdp_ready(url), "Chrome was closed"