Commit c555085
authored
test(agent): add timeout and error logging to checkAgentStatus (#7724)
The checkAgentStatus function in the test agent helper makes an HTTP
request to the test agent with no timeout. If the TCP connection is
established but no HTTP response is received, the promise hangs
indefinitely. This is a likely cause of flaky test timeouts with no
indication of the root cause (e.g. the AI Guard Windows CI job).
Add a 2s timeout with a descriptive warning so hangs are caught early
and the cause is visible in CI logs. Also log unexpected errors (other
than ECONNREFUSED, which is the normal "no test agent" case) to aid
future debugging.1 parent c820334 commit c555085
1 file changed
+19
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | 230 | | |
233 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
237 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
238 | 253 | | |
239 | 254 | | |
240 | 255 | | |
| |||
0 commit comments