Fix flaky assertion in OverlappingExtensions_AllMatchTypes_Comprehensive - #133893
Merged
Merged
Conversation
|
Azure Pipelines: 16 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
…ar* paths Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-io |
Copilot
AI
changed the title
[WIP] Fix OverlappingExtensions_AllMatchTypes_Comprehensive test failure
Fix flaky assertion in OverlappingExtensions_AllMatchTypes_Comprehensive
Sep 14, 2026
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
jozkee
reviewed
Sep 14, 2026
jozkee
reviewed
Sep 14, 2026
Co-authored-by: David Cantú <dacantu@microsoft.com>
jozkee
reviewed
Sep 14, 2026
jozkee
marked this pull request as ready for review
September 14, 2026 19:09
|
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.
🟢 Approval recommended
The deterministic exact-path assertions address the flaky test without product changes.
Pull request overview
This test-only PR fixes a flaky filesystem enumeration assertion by using deterministic exact-path comparisons.
Changes:
- Verifies all expected
bar*results exactly. - Strengthens path matching assertions.
File summaries
| File | Description |
|---|---|
src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Enumeration/MatchTypesTests.cs |
Makes path assertions deterministic and precise. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
This was referenced Sep 14, 2026
Open
This was referenced Sep 14, 2026
adamsitnik
approved these changes
Sep 15, 2026
adamsitnik
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you for fixing the flaky test and closing one of very few remaining .NET 11 issues @jozkee
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.
MatchTypesTests.OverlappingExtensions_AllMatchTypes_Comprehensiveasserted that nobar*result contained the substring"foo"— but checked the full absolute path.GetTestFilePath()appends random characters, so whenever those characters happened to spellfoo(e.g./tmp/#MatchTypesTests_Directory_GetFiles_foopzs3q...), every result matched and the test failed. Not a product regression.Changes
bar*matches, which is strictly stronger (verifies identity, not just count) and independent of the random directory name.Also scanned for other places where this could happen in the test file.