aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_content_blocklist.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-07 21:31:10 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-07 21:31:10 +0200
commit92e6b9823119b5461efc304a81e79e186a928e6d (patch)
treea58a742140025b553b6872e3269ad54c3ac601b5 /packages/meshbay-node/tests/test_content_blocklist.py
parentd3bc50cca1c4dfe143c29a522b8cd57eb69ab92e (diff)
downloadmeshbay-92e6b9823119b5461efc304a81e79e186a928e6d.tar.gz
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/tests/test_content_blocklist.py')
-rw-r--r--packages/meshbay-node/tests/test_content_blocklist.py11
1 files changed, 6 insertions, 5 deletions
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]