Commit 9d7170c
committed
test: fail fast on missing VCR cassettes by converting errors to 404
If a VCR cassette or a specific interaction is missing, the OSV client
would previously retry the request 4 times with exponential backoff,
causing significant delays in test execution (over 20 seconds).
This change wraps the VCR client transport in tests to intercept the
"requested interaction not found" error and convert it to a "404 Not Found"
response. Since the OSV client does not retry on 404 status codes, this
allows tests to fail immediately (~0.02s) on missing cassettes/interactions
while still preserving retry behavior for genuine transient network errors.
- Implemented vcrErrorWrappingTransport in internal/testcmd/vcr.go
- Wrapped the VCR client transport in InsertCassette1 parent f9ffc38 commit 9d7170c
1 file changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
| |||
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
0 commit comments