corrade
corrade copied to clipboard
Tests that no Windows handles are leaked in Directory APIs
Hi @mosra !
As per gitter, here's the fix for the leaking handle. Windows will refuse to delete folders with open handles, which means every list()
-ed folder would be locked until application exit.
Best, Jonathan
Edit by @mosra -- things to do in addition to Windows handle leak counting because yes everything turns into a "fixing a lightbulb" problem after a while:
- [ ] Make it possible to have checks in a teardown routine (I have branch for this somewhere)
- [ ] Turn this into a teardown check that's attached for test cases that access the OS APIs
- [ ] Figure out a way to check file descriptor leaks on Unix as well (mainly for tests that map empty files, etc.)
- On Linux check the number of entries in
/proc/self/fd
before and after - On macOS it's
/dev/fd
?? https://stackoverflow.com/a/42483033
- On Linux check the number of entries in
- [ ] Checking that we're
errno
clean in Directory APIs / tests (in particular, if some API such asrm()
fails, it should clean errno after itself)
Merged the fix alone in 515cc7e31e2c76903a19c52d2b6c82a0f8ccbb96, keeping this open so I have a reminder to add the handle counting to all tests.
Thanks!