diag: time the Windows daemon shutdown steps (do not merge)

Draft
BO
3d ago
+43-3

Diagnostic only, to be closed unmerged. The Windows lifecycle job sometimes sees the daemon log "Shutting down (idle timeout)" and then not exit within 8 s. This branch times each shutdown step in the disconnect test's preload and repeats that test 20 times, so a failed repeat prints where the time went. It doesn't reproduce on a local Windows machine (60 of 60 passes).


Summary by cubic

Diagnostic-only branch, to be closed unmerged. The Windows lifecycle job sometimes logs "Shutting down (idle timeout)" but the daemon doesn't exit within 8 seconds; this branch times each shutdown step and repeats the disconnect test 20 times so a failed run shows where the time went.

  • The preload fixture now logs each shutdown step's start/end and samples active resources.
  • The test repeats 20 times and, when STOP_DIAG_DIR is set, saves every run's log.
  • Doesn't reproduce locally: 60 of 60 passes.

Summary by CodeRabbit

  • Tests
    • Expanded coverage of daemon shutdown when a client disconnects before completing its connection. The test now repeats this scenario and checks for delayed exits, with clearer failure details and optional logs to help investigate cases where the daemon does not stop as expected.