From d9381db20cdf5237dddd283f8c8228d02673d8ce Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sat, 15 Aug 2026 21:12:57 -0700 Subject: [PATCH] Fix stale hook and setup pin checks --- archivebox/tests/test_cli_run.py | 22 +++++++++++++--------- archivebox/tests/test_hooks.py | 4 ++-- bin/setup.sh | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/archivebox/tests/test_cli_run.py b/archivebox/tests/test_cli_run.py index 5a143ad7..61260958 100644 --- a/archivebox/tests/test_cli_run.py +++ b/archivebox/tests/test_cli_run.py @@ -1660,7 +1660,7 @@ class TestRecoverOrchestratorState: @pytest.mark.django_db(transaction=True) @pytest.mark.timeout(300) @pytest.mark.parametrize("chrome_isolation", ["crawl", "snapshot"]) - def test_resume_queued_chrome_wait_reruns_background_prerequisites( + def test_resume_queued_chrome_navigate_reruns_background_prerequisites( self, initialized_archive, recursive_test_site, @@ -1700,21 +1700,25 @@ class TestRecoverOrchestratorState: ) assert list_process.returncode == 0, list_process.stderr or list_process.stdout chrome_results = parse_jsonl_output(list_process.stdout) - wait_record = next(record for record in chrome_results if record["hook_name"] == "on_Snapshot__11_chrome_wait") - snapshot_id = wait_record["snapshot_id"] + navigate_record = next( + record + for record in chrome_results + if record["hook_name"] == "on_Snapshot__30_chrome_navigate" + ) + snapshot_id = navigate_record["snapshot_id"] with use_archivebox_db(initialized_archive): tab_result = ArchiveResult.objects.get( snapshot_id=snapshot_id, plugin="chrome", - hook_name="on_Snapshot__10_chrome_tab.daemon.bg", + hook_name="on_Snapshot__01_chrome_tab.daemon.bg", ) first_tab_process_id = tab_result.process_id assert first_tab_process_id is not None update_process = run_archivebox_cmd( ["archiveresult", "update", "--status=queued"], - stdin=next(line for line in list_process.stdout.splitlines() if wait_record["id"] in line) + "\n", + stdin=next(line for line in list_process.stdout.splitlines() if navigate_record["id"] in line) + "\n", cwd=initialized_archive, env=env, timeout=60, @@ -1741,19 +1745,19 @@ class TestRecoverOrchestratorState: cleanup_process_group(run_process.pid) with use_archivebox_db(initialized_archive): - wait_result = ArchiveResult.objects.get( + navigate_result = ArchiveResult.objects.get( snapshot_id=snapshot_id, plugin="chrome", - hook_name="on_Snapshot__11_chrome_wait", + hook_name="on_Snapshot__30_chrome_navigate", ) tab_result = ArchiveResult.objects.get( snapshot_id=snapshot_id, plugin="chrome", - hook_name="on_Snapshot__10_chrome_tab.daemon.bg", + hook_name="on_Snapshot__01_chrome_tab.daemon.bg", ) assert run_process.returncode == 0 - assert wait_result.status == ArchiveResult.StatusChoices.SUCCEEDED + assert navigate_result.status == ArchiveResult.StatusChoices.SUCCEEDED assert tab_result.process_id is not None assert tab_result.process_id != first_tab_process_id diff --git a/archivebox/tests/test_hooks.py b/archivebox/tests/test_hooks.py index d4c4bf55..a4e02910 100755 --- a/archivebox/tests/test_hooks.py +++ b/archivebox/tests/test_hooks.py @@ -70,7 +70,7 @@ class TestBackgroundHookDetection: assert foreground_hooks assert all(".bg." in hook.name for hook in background_hooks) assert all(".bg." not in hook.name for hook in foreground_hooks) - assert any(hook.name == "on_Snapshot__10_chrome_tab.daemon.bg.js" for hook in background_hooks) + assert any(hook.name == "on_Snapshot__01_chrome_tab.daemon.bg.js" for hook in background_hooks) assert any(hook.name == "on_Snapshot__06_wget.finite.bg.py" for hook in background_hooks) assert any(hook.name == "on_Snapshot__93_hashes.py" for hook in foreground_hooks) @@ -227,7 +227,7 @@ class TestHookDiscovery: hooks = discover_hooks("Snapshot", filter_disabled=False) hook_names = [h.name for h in hooks] - assert "on_Snapshot__10_chrome_tab.daemon.bg.js" in hook_names + assert "on_Snapshot__01_chrome_tab.daemon.bg.js" in hook_names assert "on_Snapshot__21_consolelog.daemon.bg.js" in hook_names assert "on_Snapshot__06_wget.finite.bg.py" in hook_names assert all(hook.is_file() for hook in hooks) diff --git a/bin/setup.sh b/bin/setup.sh index 36606932..c0160fa7 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -81,7 +81,7 @@ ARCHIVEBOX_PYTHON="${ARCHIVEBOX_PYTHON:-3.13}" ARCHIVEBOX_PACKAGE="${ARCHIVEBOX_PACKAGE:-archivebox>=0.9.0rc0,<0.10}" ARCHIVEBOX_PLATFORM="${ARCHIVEBOX_PLATFORM:-}" ARCHIVEBOX_COMPOSE_URL="${ARCHIVEBOX_COMPOSE_URL:-https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/${ARCHIVEBOX_BRANCH}/docker-compose.yml}" -ABXPKG_PACKAGE="${ABXPKG_PACKAGE:-abxpkg==1.12.90}" +ABXPKG_PACKAGE="${ABXPKG_PACKAGE:-abxpkg==1.12.91}" ABXPKG_LIB_DIR="${ABXPKG_LIB_DIR:-$HOME/.cache/archivebox/setup-abxpkg}" ARCHIVEBOX_HOME_DIR="$HOME/archivebox" ARCHIVEBOX_DATA_DIR="$ARCHIVEBOX_HOME_DIR/data"