Commit 138225e
committed
test(cache-with-ttl): fix flaky getAll test for persistent cache
Fix race condition in "should return entries from both memory and persistent cache" test.
The test was failing intermittently because cacache's persistent writes are asynchronous
and may not complete immediately after await cache.set() returns.
Solution: Add verification step to ensure persistent writes complete by reading entries
back from persistent cache before testing getAll(). This eliminates the race condition
and makes the test deterministic.
Verified with 100+ consecutive test runs without failure.1 parent 010691a commit 138225e
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
350 | 360 | | |
351 | 361 | | |
352 | 362 | | |
| |||
0 commit comments