Skip to content

test(windows): repair the Windows MSVC test suite - #4862

Merged
krishicks merged 5 commits into
mainfrom
test/4861-windows-msvc-suite/krishicks
Oct 23, 2026
Merged

krishicks merged 5 commits into
mainfrom
test/4861-windows-msvc-suite/krishicks

Conversation

@krishicks

@krishicks krishicks commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix the 15 tests that fail on the Windows MSVC runners on main. One commit per failure class; each commit message explains what broke and how it is fixed.

Related Issue

Closes #4861

Changes

  • fix(isolation): validate Unix socket paths with a new openshell_core::paths::is_posix_absolute instead of the host-dependent Path::is_absolute(). Unix transport only runs on Unix hosts, so these paths are always POSIX paths. Behavior on Unix is unchanged.
  • test(supervisor): run the baseline write-back startup tests only on Unix, where the proxy baseline paths exist.
  • test(server): make fewer writes per writer in the SQLite concurrent-write test on Windows, where slow fsync starves writers past the busy timeout.
  • test(server): hold scope-mix locks by yielding until a wall-clock deadline instead of sleeping, so Windows timer granularity does not inflate 1-2 ms holds to ~16 ms.
  • test(supervisor): run the sandbox instance host tests only on Unix, since hosted sandbox instances require a Unix host.

Testing

  • cargo clippy --tests clean for openshell-core, openshell-sandbox-backend, openshell-supervisor, and openshell-server on macOS
  • Unit tests added/updated (is_posix_absolute_ignores_host_path_syntax)
  • Windows MSVC x64 and arm64 test jobs pass (test:windows)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

Prior to this change, SandboxTransport::validate checked Unix socket
paths with Path::is_absolute(). On Windows that requires a drive or UNC
prefix, so a POSIX path such as /run/backend.sock was rejected as
"invalid boundary control transport endpoint". The isolation backend
registration work in #3898 added tests that register Unix endpoints
in the core registration types, gateway config, gateway config
preflight, and supervisor backend setup; all of them failed on the
Windows MSVC runners. The Windows test job only runs on PRs labeled
test:windows, so the break went unnoticed on main.

Unix transport is refused at runtime on non-Unix hosts, so these paths
are always POSIX paths regardless of where they are validated. Now, both
the core registration validator and the sandbox backend protocol
validator use a new openshell_core::paths::is_posix_absolute helper,
which applies the POSIX rule (the path starts with '/') on every host.
On Unix this matches is_absolute() exactly.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
@krishicks krishicks added the test:windows Run native Windows x64 and ARM64 lint/tests on PR mirrors label Oct 22, 2026
The startup policy write-refusal tests from #3785 rely on
enrich_proto_baseline_paths adding the proxy baseline paths (/usr,
/tmp, /dev/null, ...) to a policy, which triggers a write-back that the
fake gateway then refuses. Enrichment only adds paths that exist on the
host. Prior to this change, the tests assumed those paths exist, so on
Windows enrichment added nothing, the precondition assertions failed,
and the baseline case of permanent_codes_still_exit never saw a write
to refuse.

Now, the four baseline write-back tests are gated to Unix, and
permanent_codes_still_exit checks the image policy upload case on every
host and the baseline write-back case only on Unix.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
sqlite_concurrent_writes_return_their_own_resource_version (#4408) runs
8 writers that each make 25 unconditional and 25 version-checked writes
against one row of an on-disk WAL database with synchronous=FULL.
Writers serialize on the SQLite write lock and wait out sqlx's default
5s busy_timeout. Prior to this change, the per-commit fsync cost on the
Windows runners was high enough that a waiting writer starved past that
timeout and failed with "database is locked" after about 7s.

Now, each writer makes 5 writes on Windows and 25 elsewhere. The test
still races every writer on the same row, which is what it checks.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
random_scope_mix_never_deadlocks (#4147) runs 64 tasks of 50 random
lock operations and holds each operation's locks for 0-2 ms, failing if
the mix does not finish within 20s. Prior to this change, the hold was a
tokio::time::sleep. Windows timers round a 1 ms sleep up to about 16 ms,
and a quarter of the operations take the exclusive global lock, so the
serialized holds alone took several seconds and the full mix exceeded
the 20s deadline on the Windows runners.

Now, occupy yields until a std::time::Instant deadline, so holds last
0-2 ms of wall-clock time on every platform and the deadline means the
same thing everywhere.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
The sandbox_instance_host tests added with per-instance supervisor
state (#4701) admit hosted instances through SandboxInstanceHost::new,
which prepares a private directory per instance. Hosted sandbox
instances are Unix-only: on other hosts prepare_private_dir returns
"hosted sandbox instances require a Unix host". Prior to this change,
the test module still compiled and ran on Windows, so all three tests
failed while creating their host.

Now, the test module is gated to Unix, and the Unix-only permission
check inside one test no longer needs its own cfg attribute.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
@krishicks
krishicks force-pushed the test/4861-windows-msvc-suite/krishicks branch from 27c7a19 to e7ce2a8 Compare October 23, 2026 17:05
@krishicks
krishicks enabled auto-merge October 23, 2026 17:55
@krishicks
krishicks added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 92434dc Oct 23, 2026
81 checks passed
@krishicks
krishicks deleted the test/4861-windows-msvc-suite/krishicks branch October 23, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:windows Run native Windows x64 and ARM64 lint/tests on PR mirrors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(windows): Windows MSVC test suite fails on main

2 participants