From efbcff05721e71f1fdfcc30b7ee1b44ca1670762 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 13 Oct 2026 00:30:39 +0200 Subject: test(node): run the connection processes on Windows, source and frozen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Connection processes and the larger UDP receive buffer were written and measured on Linux; nothing had run on Windows, and `meshbay-node.exe webrtc-worker` had never run from a frozen build on any system. - test_connection_processes.py failed on Windows (8 tests): the selector loop the suite uses there cannot start a process. A test marked `daemon_loop` now runs on the daemon's own loop, chosen through pytest-asyncio's loop factories. - The build starts both frozen executables as connection processes and carries a connection through each (smoke-connection-process.py). The daemon's own smoke test never signs in to a hub, which is when the processes start. - The warning for a receive buffer below what was asked named net.core.rmem_max on every system; it names it on Linux only. Windows grants the 4 MB. Measured on an installed build in service mode, docs/WINDOWS-PORT.md ยง5.12: two processes at startup and on a live change, a browser's handshake, chat, a 200 MB download over 8 connections across both processes, an upload, a video stream, and stop, restart and start leaving no process behind. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-node/tests/test_packaging_win.py | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'packages/meshbay-node/tests/test_packaging_win.py') diff --git a/packages/meshbay-node/tests/test_packaging_win.py b/packages/meshbay-node/tests/test_packaging_win.py index 6f6388e..69eefc8 100644 --- a/packages/meshbay-node/tests/test_packaging_win.py +++ b/packages/meshbay-node/tests/test_packaging_win.py @@ -369,6 +369,30 @@ def test_the_build_starts_the_frozen_daemon_not_only_its_help(): assert 'url = "http://127.0.0.1:1"' in smoke +def test_the_build_starts_a_frozen_connection_process(): + """Above one `connection_processes` a frozen node starts copies of itself, + `meshbay-node.exe webrtc-worker`. No source checkout takes that path and + the daemon's smoke test stops short of it: it never signs in to a hub, + which is when the processes start.""" + build = (WIN / "build-node-runtime.ps1").read_text(encoding="utf-8") + step = build.split("smoke test: the frozen node as a connection process", 1)[1] + assert 'smoke-connection-process.py") $exe (Join-Path $OutDir "meshbay-nodew.exe")' in step + assert "if ($LASTEXITCODE -ne 0) { throw" in step + # The other end is the node's own modules, in the build interpreter: removed + # any earlier, the step has nothing to run with. + assert build.count("Remove-Item -Recurse -Force $BuildVenv") == 1 + assert "Remove-Item -Recurse -Force $BuildVenv" in step + + smoke = (WIN / "smoke-connection-process.py").read_text(encoding="utf-8") + assert 'workers._argv = lambda: [exe, "webrtc-worker"]' in smoke + # The words a frozen node starts itself with, and the ones it answers to. + node = ROOT / "packages" / "meshbay-node" / "src" / "meshbay_node" + assert 'return [sys.executable, "webrtc-worker"]' in ( + node / "transport" / "webrtc" / "workers.py").read_text(encoding="utf-8") + assert 'if sys.argv[1:2] == ["webrtc-worker"]:' in ( + node / "daemon.py").read_text(encoding="utf-8") + + def _run_stop_node(tmp_path, dummy_name, localappdata): """stop-node.ps1 as setup runs it, with the process and task names swapped for ones that belong to this test -- the real ones would stop the -- cgit v1.2.3