Skip to content

test_relay_drift::test_restart_when_lists_differ fails on Windows hosts (os.path.join path-sep bug) #67

Description

@ehsan6sha

Summary

tests/test_relay_drift.py::test_restart_when_lists_differ fails on Windows dev machines but passes on Linux. Pre-existing — discovered while running the suite during the Blox AI plan implementation (Phase 18 cycle).

Failure

tests\test_relay_drift.py:71: in test_restart_when_lists_differ
    mock_sub.run.assert_called_once()
AssertionError: Expected ''run'' to have been called once. Called 0 times.

Captured stdout:
  WARNING  root:readiness-check.py:902 discovery: /usr/bin/fula\update_kubo_config.py not found; cannot apply new relay list

The captured warning is the clue: backslash separator in the path.

Root cause

readiness-check.py:900 does:

update_script = os.path.join(FULA_PATH, update_kubo_config.py)

where FULA_PATH = /usr/bin/fula (hardcoded for Linux target). On Windows, os.path.join produces /usr/bin/fula\update_kubo_config.pyos.path.isfile() returns False, so the code logs the warning and skips subprocess.run, which is what the test asserts wasn''t skipped.

Why it does not affect production

The hardcoded path is correct for the RK3588 target where readiness-check.py actually runs. The bug is purely test-host-environmental — the test does not isolate the path check from the real filesystem.

Suggested fix

Patch the test to either:

  1. Stub os.path.isfile(update_script) → True for the duration of the test. Smallest diff.
  2. Create the file under a temp dir, monkeypatch FULA_PATH to point at the temp dir. Tighter — exercises the actual path-join logic.

Option 2 is more thorough but option 1 is acceptable since the test is about the restart trigger, not the script-resolution path.

Repro

# Windows
python -m pytest tests/test_relay_drift.py::test_restart_when_lists_differ -v
# expect: AssertionError as above

Scope

  • File: tests/test_relay_drift.py:51-73
  • Not blocking the Blox AI plan release; all 22 phases'' work runs green except this one test.
  • Should be batched with any other Windows-portability test fixes if such exist.

Discovered during

Blox AI plan Phase 18 cycle, 2026-05-24.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions