Skip to content

fix(observer): slice 7c — un-ignore Windows path-specific test + install diagnostics (#551) - #572

Merged
zackees merged 1 commit into
mainfrom
hooks
Jun 22, 2026
Merged

zackees merged 1 commit into
mainfrom
hooks

Conversation

@zackees

@zackees zackees commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

The slice 7c `#[ignore]`'d Windows path-specific test was hanging because of a self-inflicted assertion bug, not a retour or detour issue. The interposer formats paths via `{:?}` (debug-escaped, doubled backslashes), so `contains(probe_path)` against the raw path never matched and the 10-second deadline ran to completion. The retour install actually completed on all 5 detours, and the CreateFileW detour fires correctly on testbin-createfilew-probe's call.

Captured stderr from a successful run:

```
RPO_HOOK install-thread-start
RPO_HOOK install begin=CreateFileW
RPO_HOOK install end=CreateFileW
... (4 more begin/end pairs) ...
RPO_HOOK install-thread-done
RPO_HOOK file-open path="C:\Users\...\probe.txt" access=0x80000000 disposition=3 handle=0xbc
RPO_HOOK file-close path="C:\Users\...\probe.txt" handle=0xbc
```

Changes

  • Interposer: per-detour `install begin=` / `end=` sentinels — quick regression tripwire if a future change breaks an install.
  • Slice 7c test: un-ignore + replace exact-path match with `contains("RPO_HOOK file-open") && contains("probe.txt")`. Basename alone is unambiguous (fixture only opens that one file).
  • New observational test `interposer_diagnostic_windows.rs` — injects into cmd.exe, reports per-detour begin/end coverage via eprintln. Always passes; output lands in CI logs for debugging visibility.

Verification

```
$ soldr cargo test -p running-process-observer --features embed-helper
--test interposer_integration_windows
test interposer_dll_fires_rpo_hook_after_inject ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; finished in 7.10s

$ soldr cargo test -p running-process-observer --features embed-helper
--test interposer_diagnostic_windows -- --nocapture
test diagnose_install_progress ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; finished in 13.22s
```

Where this leaves #551

All three tier-1 platforms now have integration tests asserting that the interposer detour fires on a real file API call with the expected path.

🤖 Generated with Claude Code

…detour install diagnostics (#551)

The slice 7c test was hanging because of a self-inflicted
assertion bug, not a retour or detour issue. The interposer
formats paths via `{:?}` (debug-escaped, doubled backslashes), so
`contains(probe_path)` against the raw path never matched and the
10-second deadline ran to completion. The retour install actually
completed on all 5 detours, and the CreateFileW detour fired
correctly on testbin-createfilew-probe's call.

Fixes:

- `crates/.../interposer-windows/src/lib.rs`: install_detours now
  emits `RPO_HOOK install begin=<name>` / `install end=<name>`
  sentinels around each install_one call. Lets the
  `interposer_diagnostic_windows.rs` test (also added) report
  which retour install hung or errored if a regression ever
  reintroduces the hang. Verified clean against cmd.exe — all
  5 detours install in <100 ms each.

- `crates/.../observer/tests/interposer_integration_windows.rs`:
  un-ignore `interposer_dll_fires_rpo_hook_after_inject`. Replace
  `contains(probe_path.display())` with `contains("RPO_HOOK
  file-open") && contains("probe.txt")` for both the deadline-
  poll exit condition and the final assertion. The basename
  alone is unambiguous since the fixture only ever opens that
  file.

- `crates/.../observer/tests/interposer_diagnostic_windows.rs`:
  new diagnostic test that injects into cmd.exe and reports
  per-detour begin/end pair coverage to eprintln. Always passes
  (observational test) — its eprintln output lands in cargo
  nextest logs for CI / debugging visibility.

Verified locally:
  test interposer_dll_fires_rpo_hook_after_inject ... ok (7.10s)
  test diagnose_install_progress ... ok (13.22s)

Closes the slice 7c gap in #551's slice 7 acceptance criterion:
Windows test now asserts the detour fires on a real (non-
diagnostic) file API call, matching the assertion strength of
Linux (7d) and macOS (7e).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 4d327fa into main Jun 22, 2026
16 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant