From 92e6b9823119b5461efc304a81e79e186a928e6d Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 7 Oct 2026 21:31:10 +0200 Subject: perf(node): list a group's directories off the event loop Every full index walked all roots on the loop, and a node with several large roots stopped answering for seconds. Walk directories only, on the roots' disk thread; index_sync is spawned and still answers on failure. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-node/tests/test_content_blocklist.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'packages/meshbay-node/tests/test_content_blocklist.py') diff --git a/packages/meshbay-node/tests/test_content_blocklist.py b/packages/meshbay-node/tests/test_content_blocklist.py index 0e07787..8e0b790 100644 --- a/packages/meshbay-node/tests/test_content_blocklist.py +++ b/packages/meshbay-node/tests/test_content_blocklist.py @@ -129,7 +129,7 @@ async def test_a_public_group_refuses_a_blocked_file_and_its_thumbnail(tmp_path) @pytest.mark.asyncio async def test_a_public_group_does_not_list_a_blocked_file(tmp_path): s, gek = _session("public", tmp_path) - s._do_index_sync() + await s._do_index_sync() payload = unseal(gek, PURPOSE_INDEX, "index_sync", GROUP, s._channel.sent[-1]) assert [e["id"] for e in payload["entries"]] == [KEPT] @@ -137,7 +137,7 @@ async def test_a_public_group_does_not_list_a_blocked_file(tmp_path): @pytest.mark.asyncio async def test_a_private_group_is_untouched(tmp_path): s, gek = _session("private", tmp_path) - s._do_index_sync() + await s._do_index_sync() payload = unseal(gek, PURPOSE_INDEX, "index_sync", GROUP, s._channel.sent[-1]) assert sorted(e["id"] for e in payload["entries"]) == [BLOCKED, KEPT] assert not s._refuse_blocked(BLOCKED) @@ -218,14 +218,15 @@ def _daemon(tmp_path, visibility: str): return daemon, session, gek -def test_a_pushed_block_resends_the_index_without_the_file(tmp_path): +@pytest.mark.asyncio +async def test_a_pushed_block_resends_the_index_without_the_file(tmp_path): daemon, session, gek = _daemon(tmp_path, "public") - daemon._on_blocklist_update([BLOCKED], []) + await daemon._on_blocklist_update([BLOCKED], []) msg = session._send.call_args[0][0] ids = [e["id"] for e in unseal(gek, PURPOSE_INDEX, "index_sync", GROUP, msg)["entries"]] assert ids == [KEPT] - daemon._on_blocklist_update([], [BLOCKED]) + await daemon._on_blocklist_update([], [BLOCKED]) msg = session._send.call_args[0][0] ids = sorted(e["id"] for e in unseal(gek, PURPOSE_INDEX, "index_sync", GROUP, msg)["entries"]) assert ids == [BLOCKED, KEPT] -- cgit v1.2.3