Commit 0b6baeb
committed
test(robot): close the real cache connection before simulating corruption
The two corruption-recovery tests replaced the live connection with a fake
one but never closed the real one. On Windows the orphaned handle kept
cache.db open, so the rebuild could not delete the file and reopened the
stale data, failing the assertions (read returned an entry, clear_all
returned 1). POSIX hid this because deleting an open file is allowed.
Closing the real connection first mirrors what _rebuild does in production,
where self._conn is always the real connection it closes before purging.1 parent 2ec7a9c commit 0b6baeb
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
| |||
346 | 349 | | |
347 | 350 | | |
348 | 351 | | |
| 352 | + | |
| 353 | + | |
349 | 354 | | |
350 | 355 | | |
351 | 356 | | |
| |||
0 commit comments