| ... | @@ -675,6 +675,12 @@ test "deleteDir" { | ... | @@ -675,6 +675,12 @@ test "deleteDir" { |
| 675 | test "Dir.rename files" { | 675 | test "Dir.rename files" { |
| 676 | try testWithAllSupportedPathTypes(struct { | 676 | try testWithAllSupportedPathTypes(struct { |
| 677 | fn impl(ctx: *TestContext) !void { | 677 | fn impl(ctx: *TestContext) !void { |
| | 678 | // Rename on Windows can hit intermittent AccessDenied errors |
| | 679 | // when certain conditions are true about the host system. |
| | 680 | // For now, skip this test when the path type is UNC to avoid them. |
| | 681 | // See https://github.com/ziglang/zig/issues/17134 |
| | 682 | if (ctx.path_type == .unc) return; |
| | 683 | |
| 678 | const missing_file_path = try ctx.transformPath("missing_file_name"); | 684 | const missing_file_path = try ctx.transformPath("missing_file_name"); |
| 679 | const something_else_path = try ctx.transformPath("something_else"); | 685 | const something_else_path = try ctx.transformPath("something_else"); |
| 680 | | 686 | |
| ... | @@ -711,6 +717,12 @@ test "Dir.rename files" { | ... | @@ -711,6 +717,12 @@ test "Dir.rename files" { |
| 711 | test "Dir.rename directories" { | 717 | test "Dir.rename directories" { |
| 712 | try testWithAllSupportedPathTypes(struct { | 718 | try testWithAllSupportedPathTypes(struct { |
| 713 | fn impl(ctx: *TestContext) !void { | 719 | fn impl(ctx: *TestContext) !void { |
| | 720 | // Rename on Windows can hit intermittent AccessDenied errors |
| | 721 | // when certain conditions are true about the host system. |
| | 722 | // For now, skip this test when the path type is UNC to avoid them. |
| | 723 | // See https://github.com/ziglang/zig/issues/17134 |
| | 724 | if (ctx.path_type == .unc) return; |
| | 725 | |
| 714 | const test_dir_path = try ctx.transformPath("test_dir"); | 726 | const test_dir_path = try ctx.transformPath("test_dir"); |
| 715 | const test_dir_renamed_path = try ctx.transformPath("test_dir_renamed"); | 727 | const test_dir_renamed_path = try ctx.transformPath("test_dir_renamed"); |
| 716 | | 728 | |
| ... | @@ -722,12 +734,6 @@ test "Dir.rename directories" { | ... | @@ -722,12 +734,6 @@ test "Dir.rename directories" { |
| 722 | try testing.expectError(error.FileNotFound, ctx.dir.openDir(test_dir_path, .{})); | 734 | try testing.expectError(error.FileNotFound, ctx.dir.openDir(test_dir_path, .{})); |
| 723 | var dir = try ctx.dir.openDir(test_dir_renamed_path, .{}); | 735 | var dir = try ctx.dir.openDir(test_dir_renamed_path, .{}); |
| 724 | | 736 | |
| 725 | // The next rename in this test can hit intermittent AccessDenied | | |
| 726 | // errors when certain conditions are true about the host system. | | |
| 727 | // For now, return early when the path type is UNC to avoid them. | | |
| 728 | // See https://github.com/ziglang/zig/issues/17134 | | |
| 729 | if (ctx.path_type == .unc) return; | | |
| 730 | | | |
| 731 | // Put a file in the directory | 737 | // Put a file in the directory |
| 732 | var file = try dir.createFile("test_file", .{ .read = true }); | 738 | var file = try dir.createFile("test_file", .{ .read = true }); |
| 733 | file.close(); | 739 | file.close(); |