From 1667fdcb1a621296eefc5ed90d846c1f77715c76 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sun, 11 Oct 2026 21:17:09 +0200 Subject: fix(node): tell the Node page how many cores there are The page reads its settings from list_groups, which lacked cpu_count, so the field showed "of 1" and stayed at 1. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-node/tests/test_connection_processes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'packages/meshbay-node/tests/test_connection_processes.py') diff --git a/packages/meshbay-node/tests/test_connection_processes.py b/packages/meshbay-node/tests/test_connection_processes.py index 5eea9b9..47aded0 100644 --- a/packages/meshbay-node/tests/test_connection_processes.py +++ b/packages/meshbay-node/tests/test_connection_processes.py @@ -271,6 +271,17 @@ async def test_the_setting_is_applied_now_and_kept(state, monkeypatch): assert settings["cpu_count"] == 4 +@pytest.mark.asyncio +async def test_the_node_page_is_told_how_many_cores_there_are(state, monkeypatch): + """The page takes its settings from `list_groups`. It was told the ceiling + only by `get_node_settings`, which it never calls, and showed "of 1".""" + monkeypatch.setattr("meshbay_node.ops.settings.max_processes", lambda: 4) + state["groups_ctx"] = {} + page = (await ops.list_groups(state))["settings"] + assert page["cpu_count"] == 4 + assert page == await ops.get_node_settings(state) + + @pytest.mark.asyncio @pytest.mark.parametrize("value", [0, -1, 5, "many", True]) async def test_a_number_the_machine_cannot_honour_is_refused(state, monkeypatch, value): -- cgit v1.2.3