Skip to content

Fix flaky test - #1401

Merged
martincostello merged 3 commits into
mainfrom
fix-flaky-test
Jan 6, 2026
Merged

Fix flaky test#1401
martincostello merged 3 commits into
mainfrom
fix-flaky-test

Conversation

@martincostello

@martincostello martincostello commented Jan 6, 2026

Copy link
Copy Markdown
Owner
  • Fix flaky test by just asserting the instance check does not throw - other tests already implicitly test whether an instance actually exists.
  • Check that we don't accidentally try and delete the default instance.

Just assert the instance check does not throw - other tests already implicitly test whether an instance actually exists.
- Remove checking of invalid characters.
- Only check that we don't accidentally try and delete the default instance.
Copilot AI review requested due to automatic review settings January 6, 2026 13:45
@martincostello martincostello added the .NET Pull requests that update .net code label Jan 6, 2026
@codecov

codecov Bot commented Jan 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.94%. Comparing base (a882bec) to head (232f9fa).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1401       +/-   ##
===========================================
+ Coverage   56.56%   90.94%   +34.37%     
===========================================
  Files          21       23        +2     
  Lines        1105     1137       +32     
  Branches       91       96        +5     
===========================================
+ Hits          625     1034      +409     
+ Misses        461       78      -383     
- Partials       19       25        +6     
Flag Coverage Δ
linux 56.56% <ø> (+0.18%) ⬆️
macos 56.56% <ø> (ø)
windows 90.41% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes a flaky test in the SQL LocalDB test suite and simplifies the fuzz testing validation logic. The main focus is on making tests more reliable by removing unnecessary checks and simplifying test assertions.

  • Simplified the Can_Test_Whether_Instances_Exist() test to only verify the method doesn't throw, as other tests already validate the actual existence checking behavior
  • Removed complex invalid character validation in fuzz tests, now only checking to avoid deletion of default instances ("v11.0" and "MSSQLLocalDB")

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/SqlLocalDb.Tests/SqlLocalDbApiTests.cs Simplified the Can_Test_Whether_Instances_Exist() test by removing start/stop instance logic and changing to only assert that calling InstanceExists() doesn't throw
tests/SqlLocalDb.FuzzTests/FuzzTests.cs Removed the InvalidNameChars HashSet and simplified SanitizeInstanceName() to only filter out default instance names instead of checking for invalid characters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/SqlLocalDb.FuzzTests/FuzzTests.cs
Otherwise some characters get through and then cause tests that enumerate and test instances to fail.
@martincostello
martincostello merged commit aa90fc2 into main Jan 6, 2026
16 checks passed
@martincostello
martincostello deleted the fix-flaky-test branch January 6, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug .NET Pull requests that update .net code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants