gpui: Fix flaky hang monitor shutdown test (#64993)

`profiler::hang::tests::app_flushes_its_hang_monitor_on_shutdown` fails
intermittently on CI
([example](https://github.com/zed-industries/zed/actions/runs/36730826643/job/109954752762)).

`App::shutdown` requests a flush from the hang monitor and waits for it
with `block_with_timeout`, which in tests runs on the deterministic
`TestScheduler`. The monitor is a real OS thread (`HangDetection`), so
the outcome depends on timing:

- If the monitor finishes after shutdown starts waiting, its
`done.send(())` wakes the scheduler from the `HangDetection` thread, and
`end_test` panics with "Your test is not deterministic" (the CI
failure).
- If it hasn't finished when shutdown first checks, parking is
forbidden, so the timed wait gives up immediately and the `Some(Flush)`
assertion fails (reproduced locally).

The test now calls `cx.executor().allow_parking()`, the existing opt-in
for tests that involve real threads. Shutdown can then wait for the
flush (still capped by `SHUTDOWN_TIMEOUT`), and the cross-thread wake is
allowed. Production code is unchanged.

Before the change, locally on macOS: `ITERATIONS=200` failed once, and 1
of 500 separate-process runs failed. After the change: all 200
iterations and 300 separate-process runs (as nextest does) passed.

Release Notes:

- [GPUI] Fixed a flaky hang monitor shutdown test
4c0ead4a3eAnthony Eid committed on 9/30/2026, 3:48:08 PM· committed by GitHubparente8c6c67
1 file changedLine totals unavailable