-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.12.0-dev.1800+559e216f3
Steps to Reproduce and Observed Behavior
This test fails on Windows when run with -target aarch64-windows-gnu on other platforms and on Windows without target flag passes.
Created file is not closed and then in tmp.cleanup() deleteTree loops in trying to delete that file.
Closing created file makes test pass.
Removing line tmp.dir.close() also makes test pass without closing file.
test "not closing file" {
var tmp = std.testing.tmpDir(.{});
// This file is not closed !!!
_ = try tmp.dir.createFile("file1", .{ .exclusive = true });
// Next lines are from tmp.cleanup();
tmp.dir.close();
// This produces endless loop
tmp.parent_dir.deleteTree(&tmp.sub_path) catch {};
tmp.parent_dir.close();
}Expected Behavior
deleteTree should return an error instead of trying forever to delete the same file.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior