Skip to content

Conversation

@carlossanlop
Copy link
Contributor

Fixes #60147

A new unit test was added in #55327 to fix a Unix-only bug. This PR ensures the test is limited to only run on Unix, in both System.IO.FileSystem.Tests.csproj and in System.IO.FileSystem.Net5Compat.Tests.csproj.

Pending confirmation from @tmds that this unit test was only intended to be run on Unix.

@ghost
Copy link

ghost commented Oct 7, 2021

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

Issue Details

Fixes #60147

A new unit test was added in #55327 to fix a Unix-only bug. This PR ensures the test is limited to only run on Unix, in both System.IO.FileSystem.Tests.csproj and in System.IO.FileSystem.Net5Compat.Tests.csproj.

Pending confirmation from @tmds that this unit test was only intended to be run on Unix.

Author: carlossanlop
Assignees: carlossanlop
Labels:

area-System.IO

Milestone: -

@krwq
Copy link
Member

krwq commented Oct 11, 2021

Hey @carlossanlop what's the status? Can this be merged?

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM, but a simpler solution exists:

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsFileLockingEnabled), nameof(PlatformDetection.IsThreadingSupported))]

-         [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsFileLockingEnabled), nameof(PlatformDetection.IsThreadingSupported))]
+         [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsFileLockingEnabled), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotWindows))]

@tmds
Copy link
Member

tmds commented Oct 11, 2021

See discussion on #60147.

Alternative to skipping the test on Windows is to increase the timeout, and move it to OuterLoop if the local run on Windows takes too long. (On Linux, the local run takes a couple of seconds).

@carlossanlop
Copy link
Contributor Author

Ok, @tmds. Since we expect this test to pass on both Windows and Linux, I'll apply your suggestion:

Alternative to skipping the test on Windows is to increase the timeout, and move it to OuterLoop if the local run on Windows takes too long.

cc @adamsitnik who already gave me a sign-off; don't merge it yet.

@carlossanlop carlossanlop changed the title Limit FileStream DeleteOnClose test to only Unix Test fix: FileStream DeleteOnClose run on OuterLoop with longer timeout Oct 11, 2021
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tmds I'd like to assume this is the timeout you wanted me to extend? I ask because there are 3 Task.Delay calls above. Should I extend those as well? I wonder if 1 ms delays are long enough.

Copy link
Member

Choose a reason for hiding this comment

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

This is the one.

Copy link
Member

Choose a reason for hiding this comment

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

This is the one.

For some reason when I read it I hear:

image

@carlossanlop
Copy link
Contributor Author

@kunalspathak can I ignore this build failure? It says you manually cancelled it.

@kunalspathak
Copy link
Contributor

@kunalspathak can I ignore this build failure? It says you manually cancelled it.

Yes, the pipeline is still under development and I forgot to have proper setting to not trigger it on every PR.

@adamsitnik adamsitnik merged commit dac1290 into dotnet:main Oct 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 13, 2021
@carlossanlop carlossanlop deleted the unixOnly55327 branch July 28, 2023 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI failure in the test System.IO.Tests.FileStream_DeleteOnClose.OpenOrCreate_DeleteOnClose_UsableAsMutex

5 participants