Commit 57e990a
test(audience-session): regression test proving _initLock is released before Phase 2
Locks a Shutdown inside its Phase 2 final flush via a BlockingHandler
that never returns from SendAsync, then calls Reset on the main
thread with a stopwatch. Pre-refactor, Reset would wait on _initLock
for the full ShutdownFlushTimeoutMs (up to 10s in this test's setup).
Post-refactor, Reset acquires the lock immediately, sees
!_initialized, and returns in microseconds.
Asserts Reset completes in under 500ms — generous margin to avoid CI
flakes while still catching a regression that re-introduces a
seconds-scale hold.
Addresses the reviewer's concern from PR #699 and guards against
future changes that move blocking work back inside the lock.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0389487 commit 57e990a
1 file changed
Lines changed: 38 additions & 0 deletions
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
954 | 992 | | |
955 | 993 | | |
956 | 994 | | |
| |||
0 commit comments