Commit 5b4bc3d
committed
fix(test): add intermediate check to prevent flaky cache overwrite test
The "should overwrite existing value" test was flaky, sometimes taking
over 1 second to complete and occasionally timing out. The issue was
caused by rapid successive writes to the same cache key without
ensuring the first write had completed.
This fix adds an intermediate `get()` call after the first `set()` to
ensure the first write is fully flushed to the persistent cache before
attempting the second write. This prevents race conditions in the
underlying cacache library when writing to the same key in quick
succession.
Test execution time is now consistently under 25ms.1 parent 48a60fc commit 5b4bc3d
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| |||
0 commit comments