Skip to content

Fix flaky MsbuildRestore_StaticGraphEvaluation_HandlesInvalidProjectFileException test - #7555

Merged
nkolev92 merged 1 commit into
devfrom
dev-nkolev92-fixFlakyInvalidProjectFileTest
Jul 10, 2026
Merged

nkolev92 merged 1 commit into
devfrom
dev-nkolev92-fixFlakyInvalidProjectFileTest

Conversation

@nkolev92

@nkolev92 nkolev92 commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: N/A (engineering / test-only change)

Description

MsbuildRestore_StaticGraphEvaluation_HandlesInvalidProjectFileException is flaky. It asserted on the full MSB4025 error text including the project path:

error MSB4025: The project file could not be loaded. Could not find file '<projectB path>'

That shape of the message varies depending on the verison of msbuild being used, so the test fails intermittently (observed in CI on multiple in-flight PRs).

This relaxes the assertion to match the stable prefix error MSB4025: The project file, which still verifies that the expected invalid-project-file error is surfaced without depending on the exact wording/path.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
    • Engineering / test-only change — no issue required per the template.
  • Added tests
    • Test-only change; relaxes an assertion in an existing test.
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.
    • N/A

…InvalidProjectFileException

The test asserted on the full MSB4025 message including the project path, which is not reliably present in the MSBuild restore output and caused intermittent failures. Relax the assertion to match the 'error MSB4025: The project file' prefix instead.

Co-authored-by: Copilot <[email protected]>
@nkolev92
nkolev92 requested a review from a team as a code owner July 10, 2026 21:49
@nkolev92
nkolev92 enabled auto-merge (squash) July 10, 2026 21:50
@nkolev92
nkolev92 requested a review from Nigusu-Allehu July 10, 2026 22:13
@nkolev92
nkolev92 merged commit 2c9dd86 into dev Jul 10, 2026
20 of 21 checks passed
@nkolev92
nkolev92 deleted the dev-nkolev92-fixFlakyInvalidProjectFileTest branch July 10, 2026 23:01
nkolev92 added a commit that referenced this pull request Jul 21, 2026
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