Commit c400ba8
[Runner] Skip QuickAccessHost::stop() on OS-initiated shutdown; raise WM_ENDSESSION test threshold
Round-2 follow-up to the earlier WM_ENDSESSION + WM_DESTROY work on the
runner. Two small additions spotted on a re-read:
1. `src/runner/main.cpp` calls `QuickAccessHost::stop()` after
`run_message_loop()` returns. `QuickAccessHost::stop()` does a
`WaitForSingleObject` on the Quick Access host process up to its wait
timeout. On OS shutdown / sign-off / restart the OS reaps that
process in parallel, so the wait is pure dead time against the
quiesce budget - the same class of issue the WM_DESTROY skip
already addresses for `close_settings_window()` and the tray icon.
Fix: expose `is_session_ending()` from `tray_icon.cpp` (the
`g_session_ending` flag we already set when the runner observes
`WM_ENDSESSION(TRUE)`), and gate the `QuickAccessHost::stop()` call
on it. The user-initiated tray -> Exit path still calls `stop()`
and unwinds cleanly; only the OS-shutdown path skips the blocking
wait.
2. `src/common/UnitTests-CommonUtils/Window.Tests.cpp` -
`HandleSessionEndMessage_EndSessionConfirmed_TearsDownAndExitsLoop`
asserted `elapsed.count() < 500` against a 1000 ms `run_message_loop`
timeout. That's tight enough to be CI-flaky on a slow VM while still
not catching a real failure (the failure mode is "loop ran to full
timeout"). Raise to 2000 ms - well under the 5 s OS quiesce budget,
but with enough headroom to absorb scheduler hiccups on shared CI.
Build: `runner.vcxproj` + `UnitTests-CommonUtils.vcxproj` build clean
(x64|Release, 0 warnings / 0 errors). 18/18 tests in `WindowTests`
class pass via vstest.console.
---
ADO: https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/55588441/
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 21c5907 commit c400ba8
4 files changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
241 | | - | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
356 | 364 | | |
357 | 365 | | |
358 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
566 | 571 | | |
567 | 572 | | |
568 | 573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
0 commit comments