Skip to content

Remove resolved ActiveIssue(#14378) skip attributes from IO.FileSystem tests#125092

Open
Copilot wants to merge 7 commits intomainfrom
copilot/remove-activeissue-attribute
Open

Remove resolved ActiveIssue(#14378) skip attributes from IO.FileSystem tests#125092
Copilot wants to merge 7 commits intomainfrom
copilot/remove-activeissue-attribute

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Issue #14378 has been resolved, but 6 test methods across 4 files were still decorated with [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")], causing them to be permanently skipped on all platforms.

Description

  • Directory/Delete_MountVolume.cs — un-skip RunTest (volume mount deletion scenarios); guarded with [ConditionalFact(nameof(IsNtfs))] where IsNtfs checks FileSystemDebugInfo.IsCurrentDriveNTFS()
  • Directory/ReparsePoints_MountVolume.cs — un-skip runTest (GetDirectories/GetFiles through mount points); guarded with [ConditionalFact(nameof(IsNtfs))] for the same reason
  • Directory/Exists.cs — un-skip NotReadyDriveAsPath_ReturnsFalse and SubdirectoryOnNotReadyDriveAsPath_ReturnsFalse; converted to [ConditionalFact] with throw new SkipTestException(...) in the test body so tests are properly reported as skipped (not silently passed) when no not-ready drive is available
  • Directory/CreateDirectory.cs — un-skip NotReadyDriveAsPath_ThrowsDirectoryNotFoundException and SubdirectoryOnNotReadyDriveAsPath_ThrowsIOException; converted to [ConditionalFact] with throw new SkipTestException(...) for the same reason; fixed CS0121 ambiguity on ToTheoryData() caused by adding using Microsoft.DotNet.XUnitExtensions;

The two mount-volume tests use [ConditionalFact(nameof(IsNtfs))] where IsNtfs checks only FileSystemDebugInfo.IsCurrentDriveNTFS(), ensuring the tests run only when the current drive is NTFS (required by the SetVolumeMountPoint Win32 API).

The four not-ready-drive tests use plain [ConditionalFact] (required to enable SkipTestException to work correctly) together with throw new SkipTestException(...) in the test body when no not-ready drive is found. The drive is looked up once via a static readonly string? s_notReadyDrive field guarded with OperatingSystem.IsWindows() so that IOServices.GetNotReadyDrive() (which P/Invokes into kernel32.dll) is not called on non-Windows platforms, preventing TypeInitializationException / DllNotFoundException during class loading. This replaces the old Console.WriteLine + return anti-pattern that caused tests to silently pass with zero assertions.

All tests retain [PlatformSpecific(TestPlatforms.Windows)] and will continue to be skipped on non-Windows platforms.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…lved

Co-authored-by: ViveliDuCh <50237907+ViveliDuCh@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove ActiveIssue attribute from relevant tests Remove resolved ActiveIssue(#14378) skip attributes from IO.FileSystem tests Mar 3, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

@ViveliDuCh ViveliDuCh marked this pull request as ready for review March 3, 2026 03:27
@ViveliDuCh ViveliDuCh requested review from Copilot and jozkee March 3, 2026 03:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes 6 [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")] skip attributes from 4 System.IO.FileSystem test files, re-enabling tests that were permanently skipped while waiting for a mechanism to test machine-wide state (like mounting network drives). All tests retain [PlatformSpecific(TestPlatforms.Windows)] and will still skip on non-Windows.

Changes:

  • Remove ActiveIssue skip attribute from Delete_MountVolume.cs::RunTest (volume mount deletion scenarios)
  • Remove ActiveIssue skip attribute from ReparsePoints_MountVolume.cs::runTest (GetDirectories/GetFiles through mount points)
  • Remove ActiveIssue skip attributes from Exists.cs::NotReadyDriveAsPath_ReturnsFalse and SubdirectoryOnNotReadyDriveAsPath_ReturnsFalse
  • Remove ActiveIssue skip attributes from CreateDirectory.cs::NotReadyDriveAsPath_ThrowsDirectoryNotFoundException and SubdirectoryOnNotReadyDriveAsPath_ThrowsIOException

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Directory/Delete_MountVolume.cs Removes [ActiveIssue] from RunTest, which tests directory deletion through Windows volume mount points
Directory/ReparsePoints_MountVolume.cs Removes [ActiveIssue] from runTest, which tests GetDirectories/GetFiles traversal through volume mount points
Directory/Exists.cs Removes [ActiveIssue] from two tests that check Directory.Exists behavior on not-ready drives
Directory/CreateDirectory.cs Removes [ActiveIssue] from two tests that check Directory.CreateDirectory behavior on not-ready drives

… privileges and NTFS

Co-authored-by: ViveliDuCh <50237907+ViveliDuCh@users.noreply.github.com>
…ditionalFact in Exists.cs and CreateDirectory.cs

Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Copy link
Member

@jozkee jozkee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please address feedback.

…mplify ConditionalFact for not-ready drive tests

Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot please address feedback.

All feedback addressed in 5e84928.

@jozkee
Copy link
Member

jozkee commented Mar 3, 2026

@copilot, please fix the build errors

src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Directory/CreateDirectory.cs(13,98): error CS0121: (NETCORE_ENGINEERING_TELEMETRY=Build) The call is ambiguous between the following methods or properties: 'Microsoft.DotNet.XUnitExtensions.TheoryExtensions.ToTheoryData<T>(System.Collections.Generic.IEnumerable<T>)' and 'Xunit.TheoryDataExtensions.ToTheoryData<T>(System.Collections.Generic.IEnumerable<T>)'

…Net.XUnitExtensions using

Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot, please fix the build errors

src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Directory/CreateDirectory.cs(13,98): error CS0121: (NETCORE_ENGINEERING_TELE...

Fixed in 62d7087. Adding using Microsoft.DotNet.XUnitExtensions; (for SkipTestException) made the ToTheoryData() extension call ambiguous. Qualified it as Xunit.TheoryDataExtensions.ToTheoryData(IOInputs.GetReservedDeviceNames()) to resolve the ambiguity.

@ViveliDuCh
Copy link
Member

@copilot please address the test failures

Exception thrown "System.TypeInitializationException : The type initializer for 'System.IO.Tests.Directory_CreateDirectory' threw an exception.
---- System.DllNotFoundException : kernel32.dl"
[...] /src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57

…ws() to prevent TypeInitializationException on non-Windows

Co-authored-by: ViveliDuCh <50237907+ViveliDuCh@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot please address the test failures

Exception thrown "System.TypeInitializationException : The type initializer for 'System.IO.Tests.Directory_CreateDirectory' threw an exce...

Fixed in 4cb2e84. The s_notReadyDrive static field initializer was calling IOServices.GetNotReadyDrive() unconditionally, which P/Invokes into kernel32.dll. On non-Windows platforms this causes DllNotFoundException during class loading, crashing the entire test class with TypeInitializationException. Guarded both initializers (in CreateDirectory.cs and Exists.cs) with OperatingSystem.IsWindows() so the call is skipped on Linux/macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants