Make test file watchers more resilient#131304
Open
rosebyte wants to merge 2 commits into
Open
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Improves resiliency of Microsoft.Extensions.Configuration functional tests that validate reload-on-change behavior, aiming to reduce flakiness in file watcher–driven tests (notably on Linux/containerized/stress environments).
Changes:
- Replace one-shot file writes +
WaitForChangepolling with a newWaitForReloadhelper that re-applies file writes on each retry until the expected reload is observed. - Update the relative-path change-token test to use a
TaskCompletionSourcesignal and dispose theChangeToken.OnChangesubscription. - Re-enable several previously
[ActiveIssue]-skipped reload tests by making their wait logic more tolerant of missed/delayed notifications.
This was referenced Jul 24, 2026
Comment on lines
+1040
to
+1044
| var reloadedSignal = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously); | ||
| using IDisposable subscription = ChangeToken.OnChange(config.GetReloadToken, () => reloadedSignal.TrySetResult(true)); | ||
|
|
||
| // A relative path is watched relative to the default file provider root (AppContext.BaseDirectory), | ||
| // so write to that exact location instead of the raw relative path; otherwise the test would depend |
Member
|
I'm not convinced writing to the file repeatedly is necessary here. Other notes:
|
Contributor
|
Tagging subscribers to this area: @dotnet/area-extensions-filesystem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #126726