Commit df7750e
committed
test: fix flaky test-http2-close-while-writing
The test was flaky due to a race condition where `client.close()` would
wait for a graceful shutdown while the server had already destroyed the
session/stream, leading to a timeout.
Changes:
- Replace `client.close()` with `client.destroy()` in the `close` event
handler of the client stream.
- Add `common.mustNotCall()` error handlers to the client, client stream,
and server session to catch unexpected errors.
- Add check `if (!client_stream.destroyed)` before destroying client
stream in the server's data handler.
Refs: #331561 parent 3d30c30 commit df7750e
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| 44 | + | |
39 | 45 | | |
| 46 | + | |
40 | 47 | | |
41 | | - | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
0 commit comments