Uh oh!
There was an error while loading. Please reload this page.
Skip flaky FileConfigurationProvider test on .NET Framework - #126874
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses CI flakiness in Microsoft.Extensions.Configuration.FileExtensions tests by skipping a FileSystemWatcher-dependent integration test on .NET Framework and aligning the test’s timeout/waiting pattern with existing watcher tests.
Changes:
- Skip
ResolveFileProvider_WithMissingParentDirectory_WatchTokenFiresWhenFileCreatedon .NET Framework viaConditionalFact(... IsNotNetFramework). - Replace CTS-based timeout logic with
Task.WaitAsync(TimeSpan)andRunContinuationsAsynchronouslyfor the TCS. - Add the shared
TaskTimeoutExtensionspolyfill to the test project to supportWaitAsyncon TFMs that lack it.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/Microsoft.Extensions.Configuration.FileExtensions.Tests.csproj | Adds shared TaskTimeoutExtensions to enable WaitAsync in this test assembly. |
src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs | Skips the flaky test on .NET Framework and updates the wait/timeout implementation for the change token. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Tagging subscribers to this area: @dotnet/area-extensions-filesystem |
Uh oh!
There was an error while loading. Please reload this page.
rosebyte
left a comment
There was a problem hiding this comment.
Tarek's comment looks reasonable, please consider it before merging..
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, I am going to allow myself to merge it so the CI is in better shape. Thank you @svick !
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Note
This PR was AI/Copilot-generated.
Fixes#126787
Problem
The
ResolveFileProvider_WithMissingParentDirectory_WatchTokenFiresWhenFileCreatedtest introduced in #126411 is flaky on thenet481-windows-Release-x86CI leg, causing it to time out and block CI.Root cause
FileSystemWatcheron .NET Framework drops directory creation events under I/O contention. ThePendingCreationWatcherinPhysicalFilesWatcherrelies on FSW to detect when a missing root directory is created. When the FSW event is lost, the change token never fires and the test hangs.This was verified by:
dotnet testprocesses) reproduces the hang on net481 x86 (~3% failure rate).FileSystemWatcher(noPendingCreationWatcher) also fails under the same conditions on .NET Framework.All 7 CI failures in the issue report are on the same
net481-windows-Release-x86-NET481_Release-Windows.10.Amd64.Client.Openconfiguration.Changes
[Fact]to[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNetFramework))]since the test depends on FSW reliability that .NET Framework cannot guarantee under load.CancellationTokenSource-based timeout withTask.WaitAsync(TimeSpan)(viaTaskTimeoutExtensionspolyfill) and addedTaskCreationOptions.RunContinuationsAsynchronously— matching the pattern used by all similar tests inPhysicalFilesWatcherTests.