Commit 09b763f
fix: replace TCP readiness check with signal file to fix flaky Linux test (#59)
* fix: Replace TCP readiness check with signal file to fix flaky Linux test
Wait-ServerReady used a TCP socket connect check that succeeded as soon
as HttpListener.Start() opened the port. On Linux, the background job
had not yet called GetContextAsync(), so the test HTTP request arrived
before the listener was ready, causing intermittent failures.
Replace with a signal file approach: the background job writes a temp
file after entering GetContextAsync(), and the parent polls for that
file. This is deterministic and eliminates the race condition.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit 85de79c)
* fix: clean up test server job and signal file on readiness failure
Wrap the readiness wait in Start-TestHttpServerJob with try/catch/finally so a
startup that times out no longer leaks resources:
- The catch stops and removes the background job, releasing the HttpListener and
its 30-second GetContextAsync wait instead of orphaning the job.
- The finally always removes the readiness signal file, even when the wait times
out and throws.
- Add ValidateNotNullOrEmpty to the Wait-ServerReady SignalFile parameter.
Addresses review feedback on the integration test scaffolding.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent a083b14 commit 09b763f
1 file changed
Lines changed: 40 additions & 23 deletions
Lines changed: 40 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 58 | + | |
| 59 | + | |
69 | 60 | | |
70 | 61 | | |
71 | 62 | | |
| |||
82 | 73 | | |
83 | 74 | | |
84 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
85 | 79 | | |
86 | | - | |
| 80 | + | |
87 | 81 | | |
88 | 82 | | |
89 | 83 | | |
| |||
96 | 90 | | |
97 | 91 | | |
98 | 92 | | |
99 | | - | |
| 93 | + | |
| 94 | + | |
100 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
| |||
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
141 | 158 | | |
142 | 159 | | |
143 | 160 | | |
| |||
0 commit comments