mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
Stabilize Chrome-backed ArchiveBox tests
This commit is contained in:
parent
dacf163498
commit
7236d4bd65
@ -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:
|
||||
|
||||
@ -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"]
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user