std/fs/test.zig: Try harder to clean up locking files

This commit is contained in:
Pat Tullmann 2024-01-06 13:27:59 -08:00
parent c36962bb19
commit d35bdc8ee7

View File

@ -1559,11 +1559,11 @@ test "open file with exclusive nonblocking lock twice (absolute paths)" {
const filename = try fs.path.resolve(gpa, &.{ cwd, sub_path });
defer gpa.free(filename);
defer fs.deleteFileAbsolute(filename) catch {}; // createFileAbsolute can leave files on failures
const file1 = try fs.createFileAbsolute(filename, .{
.lock = .exclusive,
.lock_nonblocking = true,
});
defer fs.deleteFileAbsolute(filename) catch {};
const file2 = fs.createFileAbsolute(filename, .{
.lock = .exclusive,