Stabilize Chrome-backed ArchiveBox tests

This commit is contained in:
Nick Sweeting 2026-05-18 20:41:35 -07:00
parent dacf163498
commit 7236d4bd65
No known key found for this signature in database
3 changed files with 8 additions and 1 deletions

View File

@ -71,6 +71,7 @@ def test_cli_add_real_urls_with_options_writes_inspectable_outputs(tmp_path, pro
"SAVE_TITLE": "true",
"CHROME_HEADLESS": "true",
"CHROME_SANDBOX": "false",
"CHROME_ISOLATION": "snapshot",
}
system_browser = _find_system_browser()
if system_browser:

View File

@ -2,6 +2,7 @@ import asyncio
import json
import subprocess
import sys
import time
from pathlib import Path
from types import SimpleNamespace
@ -1004,7 +1005,11 @@ def test_crawl_runner_calls_load_and_finalize_run_state(monkeypatch):
asyncio.run(runner_module.CrawlRunner(crawl, snapshot_ids=[str(snapshot.id)]).run())
crawl.refresh_from_db()
for _ in range(20):
crawl.refresh_from_db()
if crawl.retry_at is not None:
break
time.sleep(0.1)
assert crawl.status == Crawl.StatusChoices.STARTED
assert crawl.retry_at is not None
assert method_calls == ["load_run_state", "finalize_run_state"]

View File

@ -10,6 +10,7 @@ FIXTURES = (disable_extractors_dict, process)
def _install_chrome(tmp_path, env):
env["CHROME_ISOLATION"] = "snapshot"
system_browser = _find_system_browser()
if system_browser:
env["CHROME_BINARY"] = str(system_browser)