Skip to content

[main] Update dependencies from microsoft/testfx - #56993

Merged
Evangelink merged 3 commits into
mainfrom
darc-main-497d23ad-4e42-4225-a59e-53fe8b9e7d41
Nov 10, 2026
Merged

Evangelink merged 3 commits into
mainfrom
darc-main-497d23ad-4e42-4225-a59e-53fe8b9e7d41

Conversation

@dotnet-maestro

@dotnet-maestro dotnet-maestro Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

This pull request updates the following dependencies.

From https://github.com/microsoft/testfx

Assert.IsNotNull compatibility

These packages contain microsoft/testfx#12273, which restores the synchronous, void-returning Assert.IsNotNull API. All three published nupkgs embed the same source commit above.

The temporary _ = Assert.IsNotNull(_lazyTask); workaround and its return-value guidance have been removed. The original assertion statement now compiles without CS4014, and watcher teardown still requests cancellation before awaiting the original task. Relative to the PR base, only eng/Version.Details.xml, generated eng/Version.Details.props, and global.json remain changed.

Validation

Windows x64, Debug, bootstrap SDK 12.0.100-alpha.1.26480.102; source-built SDK 12.0.100-dev, runtime 12.0.0-alpha.1.26528.111.

Check Result
Full solution/redist build, including the native CLI Exit 0; zero warnings and errors
dotnet-watch.Tests, CtrlRTests Exit 0; 2 executed, 2 passed, 0 failed, 0 skipped
Actual test runtime dependencies MSTest.TestFramework/MSTest.TestAdapter 5.0.0-preview.26559.7; Microsoft.Testing.Platform 3.0.0-preview.26559.7

The two passing tests are RestartsBuild and CancelsWaitForFileChange. Both exercise InProcTestWatcher.DisposeAsync, including its cancellation-before-await ordering, against the source-built SDK. The TRX was checked for those exact identities and outcomes.

The build used the installed C++ environment in the same process, without changing machine-wide settings:

& 'C:\Windows\System32\cmd.exe' /d /c 'set "PATH=C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0;%PATH%" && call "C:\Program Files\Microsoft Visual Studio\18\Insiders\VC\Auxiliary\Build\vcvars64.bat" >nul && call build.cmd -c Debug -bln testfx-update-native-env.binlog /p:IlcUseEnvironmentalTools=true /nr:false /m:8 /v:minimal /nologo'

.\.dotnet\dotnet.exe scripts\RunTests.cs -- --project test\dotnet-watch.Tests\dotnet-watch.Tests.csproj --filter 'FullyQualifiedName~CtrlRTests' --test-binlogs

Both commands used DOTNET_ADD_GLOBAL_TOOLS_TO_PATH=0, an isolated DOTNET_CLI_HOME, and task-owned TEMP/TMP. The test run also set DOTNET_SDK_TEST_EXECUTION_DIRECTORY outside the checkout so the repository's global.json could not redirect child commands to the bootstrap SDK; the product host resolved 12.0.100-dev there.

Retained local evidence:

  • artifacts\log\Debug\testfx-update-native-env.binlog
  • artifacts\log\test-runs\dotnet-watch.Tests\20261110-103848-362448\build.binlog
  • artifacts\log\test-runs\dotnet-watch.Tests\20261110-103848-362448\test-results.trx

The full test suite and all-platform CI results are not claimed.

…261106.8

On relative base path root
Microsoft.Testing.Platform From Version 2.6.0-preview.26531.5 -> To Version 3.0.0-preview.26556.8
MSTest , MSTest.Sdk From Version 4.6.0-preview.26531.5 -> To Version 5.0.0-preview.26556.8
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🔍 Build Failure Analysis

Summary — The CI build fails in all 10 legs with the identical compiler error CS4014 in test/dotnet-watch.Tests, promoted to a build-breaking error by this repo's TreatWarningsAsErrors=True setting.

Root cause: Assert.IsNotNull call is no longer fire-and-forget safe after the MSTest/Microsoft.Testing.Platform bump

This PR bumps MSTest/MSTest.Sdk from 4.6.0-preview.26531.5 → 5.0.0-preview.26556.8 and Microsoft.Testing.Platform from 2.6.0-preview.26531.5 → 3.0.0-preview.26556.8 (via eng/Version.Details.xml / eng/Version.Details.props). Every failed-build leg reports the exact same compiler error at the exact same location:

CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

at test/dotnet-watch.Tests/TestUtilities/InProcTestWatcher.cs:49, inside DisposeAsync():

public async ValueTask DisposeAsync()
{
    Assert.IsNotNull(_lazyTask);   // line 49 — now flagged CS4014
    ...

This indicates the new MSTest.TestFramework version changed (or added) an Assert.IsNotNull overload applicable to _lazyTask (a Task?) that now returns an awaitable (Task/ValueTask), so the existing synchronous, non-awaited call is treated by the compiler as a dropped-task "fire and forget" call. Because DisposeAsync() is already async, awaiting the call is a safe, minimal fix. Note the sibling call on line 23 (Assert.IsNull(_lazyTask);, inside the synchronous Start() method) is not flagged — consistent with only the IsNotNull overload picking up a new async-returning signature, rather than a blanket API change.

I could not independently confirm this from the microsoft/testfx source (no repository access from this sandbox); please cross-check against the testfx 5.0.0-preview release notes/changelog for the specific Assert.IsNotNull signature change.

Affected files / errors

  • test/dotnet-watch.Tests/TestUtilities/InProcTestWatcher.cs:49 — CS4014 in CoreCompile for dotnet-watch.Tests.csproj (reproduced identically on all 10 legs: Windows x64, Windows x64 AOT, Windows x64 FullFramework, Windows arm64 AOT, Linux arm64, Linux arm64 AOT, Linux x64, Linux x64 AOT, Mac arm64, Mac arm64 AOT)

Proposed fix (not in the PR diff — this file isn't touched by the dependency bump, so no inline suggestion was posted; a human should apply the fix as a follow-up commit on this auto-generated dependency-flow PR)

     public async ValueTask DisposeAsync()
     {
-        Assert.IsNotNull(_lazyTask);
+        await Assert.IsNotNull(_lazyTask);

If Assert.IsNotNull is not actually intended to be awaited here (e.g., it returns a discardable Task for some other purpose unrelated to the null-check itself), a maintainer familiar with the new MSTest API should confirm the right adaptation instead of blindly adding await.


Build overview (Windows x64 leg, representative of all legs)
Build: FAILED
Duration: 830.7s
MSBuild: 18.13.0-1.26480.102+a2f466a2c
Projects: 235  Errors: 2  Warnings: 1

Failed projects:
  ✗ artifacts/toolset/12.0.0-beta.26528.111/Build.proj
  ✗ sdk.slnx
  ✗ test/dotnet-watch.Tests/dotnet-watch.Tests.csproj
All MSBuild errors (2, identical pattern across all 10 legs)
Code Project File:Line Message
CS4014 dotnet-watch.Tests InProcTestWatcher.cs:49 Because this call is not awaited, execution of the current method continues before the call is completed.
(none) (build) — Build failed. (summary record emitted by MSBuild)

🤖 Generated by the Build Failure Analysis workflow using (a href="(dev.azure.com/redacted) · commit bbd0fc6

🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · copilot · sonnet50 · 207.9 AIC · ⊞ 7.6K · [◷]( · ◷)

Discard the synchronous assertion result so watcher shutdown still requests cancellation before awaiting completion. Document why awaiting the null assertion is not a safe fix.

Co-authored-by: Copilot App <[email protected]>
@Evangelink
Evangelink requested review from a team, lbussell and mthalman as code owners November 9, 2026 10:13
@Evangelink

Copy link
Copy Markdown
Member

Fixed the CS4014 build regression in 46c8bb647e.

MSTest 5's Assert.IsNotNull<T> is a synchronous assertion that returns its input. Passing _lazyTask therefore returns that same Task, which triggers CS4014 when the return value is ignored in an async method. It is not an asynchronous null check.

The fix explicitly discards that return value:

_ = Assert.IsNotNull(_lazyTask);

This preserves the existing null assertion, shutdown cancellation, and subsequent await _lazyTask. Adding await to the assertion, as suggested in the earlier automated comment, would wait for the watcher before requesting shutdown and could hang teardown. The related test guidance now documents this distinction.

Validation

Check Result
Unmodified PR Reproduced CS4014 at InProcTestWatcher.cs:49
Fixed dotnet-watch.Tests project Build exit 0; zero warnings and errors
CtrlRTests against the PR-built SDK Exit 0; 2 executed, 2 passed, 0 failed

The passing cases were RestartsBuild and CancelsWaitForFileChange, both of which exercise InProcTestWatcher.DisposeAsync.

.\.dotnet\dotnet.exe scripts\RunTests.cs -- --project test\dotnet-watch.Tests\dotnet-watch.Tests.csproj --filter 'FullyQualifiedName~CtrlRTests' --test-binlogs

The test binaries resolve MSTest.TestFramework/5.0.0-preview.26556.8 and Microsoft.Testing.Platform/3.0.0-preview.26556.8. The SDK input was the unmodified dotnet-sdk-12.0.100-ci-win-x64.zip from CI build 1670401: SDK 12.0.100-ci, runtime 12.0.0-alpha.1.26528.111, source merge 4374bcde2b50143963420e2874d41533c0556ff8 (whose parents include the original PR head bbd0fc69a09f6767844645db1e5fe34f62d6fc25).

The harness used DOTNET_SDK_ARTIFACTS_DIR pointing at artifacts\pr-sdk-validation, a DOTNET_SDK_TEST_EXECUTION_DIRECTORY outside the checkout, and DOTNET_ADD_GLOBAL_TOOLS_TO_PATH=0. This kept the CI SDK separate from partial local build outputs and the bootstrap SDK. The TRX and build binlog are retained locally under artifacts\log\test-runs\dotnet-watch.Tests\20261109-100716-263928.

Limits and separate failures: The full local redist build was blocked by the missing NativeAOT linker. A broader Hot Reload run reached ProjectAndSourceFileChange, reported CS0246 for XDocument, and then stalled waiting for changes to apply, before teardown; that run was stopped, not counted as passing. The existing request-reviewers workflow's GitHub HTTP 422 is also separate from this build fix. No full-suite or all-CI-green claim is being made.

Update MSTest and MSTest.Sdk to 5.0.0-preview.26559.7 and Microsoft.Testing.Platform to 3.0.0-preview.26559.7 from the same upstream commit. Restore the ordinary Assert.IsNotNull statement and remove the obsolete return-value guidance.

Co-authored-by: Copilot App <[email protected]>
@Evangelink
Evangelink enabled auto-merge (squash) November 10, 2026 12:08
@Evangelink
Evangelink merged commit 6093e45 into main Nov 10, 2026
26 of 27 checks passed
@Evangelink
Evangelink deleted the darc-main-497d23ad-4e42-4225-a59e-53fe8b9e7d41 branch November 10, 2026 12:09
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 11, 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.

2 participants