Skip to content

Commit fdbedda

Browse files
CopilotdanmoseleyadamsitnikCopilot
authored
Re-enable the WhenDiskIsFullTheErrorMessageContainsAllDetails test on Windows (#125707)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: danmoseley <6385855+danmoseley@users.noreply.github.com> Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent dfc0377 commit fdbedda

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ private static unsafe void Preallocate(string fullPath, long preallocationSize,
203203
{
204204
int errorCode = Marshal.GetLastPInvokeError();
205205

206-
// Only throw for errors that indicate there is not enough space.
207-
// SetFileInformationByHandle fails with ERROR_DISK_FULL in certain cases when the size is disallowed by filesystem,
208-
// such as >4GB on FAT32 volume. We cannot distinguish them currently.
206+
// Only throw for errors that indicate there is not enough space or the file is too large.
207+
// SetFileInformationByHandle fails with ERROR_DISK_FULL when the size is disallowed by filesystem,
208+
// such as >4GB on a FAT32 volume, and with ERROR_INVALID_PARAMETER on NTFS when the requested
209+
// allocation size exceeds the maximum file size supported by the filesystem or volume configuration.
209210
if (errorCode is Interop.Errors.ERROR_DISK_FULL or
210211
Interop.Errors.ERROR_FILE_TOO_LARGE or
211212
Interop.Errors.ERROR_INVALID_PARAMETER)

src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ctor_options.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ public void PreallocationSize(FileAccess access, FileMode mode)
152152
}
153153
}
154154

155-
[ActiveIssue("https://github.com/dotnet/runtime/issues/92624", TestPlatforms.Windows)]
156155
// macOS fcntl doc does not mention ENOSPC error: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
157156
// But depending on the OS version, it might actually return it.
158157
// Since we don't want to have unstable tests, it's better to not run it on macOS at all.

0 commit comments

Comments
 (0)