testscript: RemoveAll flakes after the code coverage refactor
mvdan opened this issue · comments
See https://github.com/rogpeppe/go-internal/runs/1986747862?check_suite_focus=true, for example:
non-directory found after RemoveAll: $WORK/tmp/testscript-main205091895/cover/foo-2a9d214c00ea
2021/02/26 10:31:15 cannot merge cover profiles: unlinkat $WORK/tmp/testscript-main205091895/cover: directory not empty
exit status 2
FAIL test 0.308s
These rare flakes started happening since #119 was merged. I'm not sure yet on what the underlying cause is, but I have a couple of theories I need to investigate.
I think we might be able to fix this issue alongside golang/go#30789 by retrying RemoveAll, just like Go does. I'll look at this soon, as the Windows failures are biting us in CUE:
exe.go:74: cannot delete temporary directory: CreateFile C:\Users\RUNNER~1\AppData\Local\Temp\testscript-main2212622325\bin\cue.exe: Access is denied.