Skip to content

[dotnet-watch] Misc test and product reliability fixes#52897

Merged
tmat merged 2 commits into
dotnet:release/10.0.3xxfrom
tmat:TestOutputValidation
Feb 11, 2026
Merged

[dotnet-watch] Misc test and product reliability fixes#52897
tmat merged 2 commits into
dotnet:release/10.0.3xxfrom
tmat:TestOutputValidation

Conversation

@tmat

@tmat tmat commented Feb 7, 2026

Copy link
Copy Markdown
Member
  • Enable skipped tests:
    Reenable ApplyDeltaTests.AddSourceFile #52576
    Change in DefineConstants should report rude edit and restart #49545

  • Replace most usages of WaitForOutputLineContaining and AssertOutputContains with WaitUntilOutputContains.
    The former validate exact ordering of events, which is not relevant to most test cases. It is harder to maintain reliability of these tests as we make more operations performed by watch asynchronous and/or parallelized.

  • Fix DTB - the compiler task won't set command line args property if all inputs are up to date. Roslyn works around that in VS DTB by setting property NonExistentFile. Do the same.

@tmat tmat force-pushed the TestOutputValidation branch 3 times, most recently from 8c3c3cb to 2f3f3a3 Compare February 9, 2026 19:09
@tmat

tmat commented Feb 9, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@tmat tmat changed the title Use WaitUntilOutputContains for most test output checks Misc test and product reliability fixes Feb 10, 2026
@tmat tmat changed the title Misc test and product reliability fixes [dotnet-watch] Misc test and product reliability fixes Feb 10, 2026
@tmat tmat force-pushed the TestOutputValidation branch from 2f3f3a3 to 2b87dc8 Compare February 10, 2026 18:53
@tmat

tmat commented Feb 10, 2026

Copy link
Copy Markdown
Member Author

@DustinCampbell @MichaelSimons ptal

@tmat tmat marked this pull request as ready for review February 10, 2026 21:11
@tmat tmat requested a review from a team as a code owner February 10, 2026 21:11
Copilot AI review requested due to automatic review settings February 10, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves dotnet-watch reliability by re-enabling previously skipped tests, reducing test flakiness by relaxing output-order assertions, and addressing a design-time-build (DTB) issue where compiler command-line args may not be produced when inputs/outputs are up to date.

Changes:

  • Re-enable previously skipped dotnet-watch hot reload tests and adjust expectations for current product behavior.
  • Replace many strict output-order assertions (WaitForOutputLineContaining / AssertOutputContains) with WaitUntilOutputContains to reduce test fragility.
  • Force DTB CoreCompile execution by setting NonExistentFile, ensuring command-line args are produced even when incremental build considers outputs up-to-date.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs Re-enables tests and updates output assertions to improve reliability under more async/parallel watch behavior.
test/dotnet-watch.Tests/Browser/BrowserTests.cs Updates browser-related tests to use less order-sensitive output waiting.
src/BuiltInTools/Watch/Build/EvaluationResult.cs Sets NonExistentFile to force DTB CoreCompile to run and adds a debug assertion for command-line args availability.
src/BuiltInTools/Watch/Build/BuildNames.cs Adds the NonExistentFile property name constant used by watch DTB.

Comment thread src/BuiltInTools/Watch/Build/EvaluationResult.cs
Comment thread test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs
Comment thread src/BuiltInTools/Watch/Build/EvaluationResult.cs

@DustinCampbell DustinCampbell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks reasonable to me. Take a look at the Copilot feedback though.

@tmat tmat merged commit 081f309 into dotnet:release/10.0.3xx Feb 11, 2026
29 checks passed
@tmat tmat deleted the TestOutputValidation branch February 11, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants