Skip to content

test: use unique file names in fs trace test

Rodrigo Muino Tomonari requested to merge github/fork/bnoordhuis/fix43502 into main

Should fix test flakiness that is presumably caused by the asynchronous nature of the unlink operation on Windows.

It's been observed that sub-tests randomly fail with "permission denied" errors when trying to create a new file in a directory with appropriate permissions.

The DeleteFile() NT API call makes a file inaccessible and marks it for deletion but doesn't actually delete it until the last open handle has been closed. Accessing such a file fails with ERROR_ACCESS_DENIED.

Processes can close handles manually or wait for the operating system to close them asynchronously after process termination. I speculate it's the latter that's causing the test to turn flaky.

Fixes: https://github.com/nodejs/node/issues/43502

Merge request reports

Loading