diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-27 22:21:26 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-27 22:21:26 +0200 |
| commit | a45e77df1b0024707914a446aa89d33baa223787 (patch) | |
| tree | 969a4976c91d7aaa27b11ba212f99d69e2ccce0f /packages/meshbay-node/tests/test_hot_reload_survives_client_close.py | |
| parent | c7899e2218af26f3bab6a157c70acf5eb7871da6 (diff) | |
| download | meshbay-a45e77df1b0024707914a446aa89d33baa223787.tar.gz | |
test: make both suites pass on Windows
Most of these failed on Windows for reasons that had nothing to do with the
code under test, which is how real Windows defects hid among them:
- Read and write files as UTF-8, and talk to Node in UTF-8. read_text(),
write_text() and subprocess text=True use the locale codepage, cp1252 on
Windows: "é", "—" and "→" arrived as "?" or crashed, some sixty tests.
Calls to PowerShell and schtasks are left alone -- they answer in the
console codepage.
- Import ESM harness modules by file URL (as_uri): a raw "C:\..." path is not
a module specifier.
- test_cli_golden: mask the tmp path in its JSON-escaped form, spell it the
POSIX way, record on Linux, mask the protocol version (the recording had
failed everywhere since the MNP 4.0 bump) and argparse's version-dependent
quoting; point USERPROFILE at the tmp home, or `member invite` and
`operator pair` wrote their codes into the developer's profile.
- test_disk_io_off_loop: expect what a free loop can reach on the platform's
timer, 15.6 ms on Windows, not an assumed 5 ms.
- test_root_paths_are_operator_only: expect the OS's spelling of the path.
- test_audio_meta_cache: find ffprobe with shutil.which.
Node suite on Windows: 1489 passed, none failed. Hub suite: 3 failures left,
all older than this change (two SQLite concurrency tests, one transfer resume).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/tests/test_hot_reload_survives_client_close.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_hot_reload_survives_client_close.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py b/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py index fb9eade..97c14d2 100644 --- a/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py +++ b/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py @@ -101,7 +101,7 @@ async def test_hot_loaded_group_finishes_scanning_without_anyone_awaiting_the_re data_dir = tmp_path / "data" config_path = tmp_path / "node.toml" - config_path.write_text(_toml(data_dir, first_dir)) + config_path.write_text(_toml(data_dir, first_dir), encoding="utf-8") from meshbay_node.config import load_config daemon = NodeDaemon(load_config(config_path), config_path=config_path) @@ -163,7 +163,7 @@ async def test_hot_loaded_group_finishes_scanning_without_anyone_awaiting_the_re # attach + /api/reload would leave it, then fire the reload exactly # as ui/app.py does: scheduled, NOT awaited. config_path.write_text(_toml(data_dir, first_dir, - second_group_id, second_dir)) + second_group_id, second_dir), encoding="utf-8") reload_task = asyncio.ensure_future(daemon._reload_config()) # Stand in for "the browser tab is gone": do something completely @@ -225,7 +225,7 @@ async def test_group_scoped_ops_404_until_listed_then_succeed(tmp_path): data_dir = tmp_path / "data2" config_path = tmp_path / "node2.toml" - config_path.write_text(_toml(data_dir, first_dir)) + config_path.write_text(_toml(data_dir, first_dir), encoding="utf-8") from meshbay_node.config import load_config daemon = NodeDaemon(load_config(config_path), config_path=config_path) @@ -282,7 +282,7 @@ async def test_group_scoped_ops_404_until_listed_then_succeed(tmp_path): # The same file write ops.attach_group does (a raw text append), # then the same fire-and-forget reload /api/reload now does. config_path.write_text(_toml(data_dir, first_dir, - second_group_id, second_dir)) + second_group_id, second_dir), encoding="utf-8") reload_task = asyncio.ensure_future(ops.start_reload(daemon._state)) await asyncio.sleep(0.01) |