test(security): fix flake in skill scanner cache invalidation test#32159
test(security): fix flake in skill scanner cache invalidation test#32159markfietje wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a CI flake in the skill scanner cache invalidation test by ensuring the file size changes when testing cache invalidation. The original test wrote files with identical byte sizes (
Confidence Score: 5/5
Last reviewed commit: 1c75863 |
|
|
4d60142 to
7dbb6ad
Compare
|
Closing as this has been superseded by internal stabilization fixes in main (e.g., 2f35230). Glad to see the scanner flake is addressed. |
Summary
This PR fixes a CI flake in
src/security/skill-scanner.test.tswhere the cache invalidation test could fail if the filesystemmtimeresolution was too low.Problem
The test
reuses cached findings for unchanged files and invalidates on file updateswas updating a file with content of the exact same size:Since the skill scanner cache uses both
sizeandmtimeMsfor invalidation, if thewriteFileoccurred within the same millisecond (or second, depending on FS resolution) as the first write, the scanner would incorrectly hit the cache, causing thereadSpyto only be called once instead of twice.Solution
Change the second write to have a different file size. This ensures the cache is invalidated even if
mtimeMsremains the same.Verification
pnpm checkandpnpm test src/security/skill-scanner.test.tspass locally.