Repository navigation
Commit 581f3bd
authored
fix(coderd/httpapi): stop writing websocket frames to ResponseRecorder in test (#25284)
The `mockEventSenderWrite` function in `newOneWayWriter()` wrote
WebSocket frame data to both the `net.Pipe` and the
`httptest.ResponseRecorder`. After `websocket.Accept()` calls
`WriteHeader(101)`, the recorder rejects body writes with `"response
status code does not allow body"`. When `HeartbeatClose` sends a ping,
the control frame flush routes through the recorder, producing an
ERROR-level log that `slogtest` catches as a test failure.
Removed the `recorder.Write(b)` call from the write function. The
recorder is only needed for header/status inspection; WebSocket frame
data should only go through the `net.Pipe`.
Closes coder/internal#1521
> 🤖 Generated by Coder Agents1 parent 024132e commit 581f3bd
1 file changed
Lines changed: 1 addition & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | 196 | | |
203 | 197 | | |
204 | 198 | | |
| |||
220 | 214 | | |
221 | 215 | | |
222 | 216 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | 217 | | |
236 | 218 | | |
237 | 219 | | |
238 | 220 | | |
239 | 221 | | |
240 | 222 | | |
241 | 223 | | |
242 | | - | |
| 224 | + | |
243 | 225 | | |
244 | 226 | | |
245 | 227 | | |
| |||
0 commit comments