Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET 7 #1658

Merged
merged 27 commits into from
Aug 29, 2022
Merged

Upgrade to .NET 7 #1658

merged 27 commits into from
Aug 29, 2022

Conversation

xingsy97
Copy link
Contributor

Summary of the changes

  • Add .Net 7 support for some packages

Preparation for Client Invocation

run.ps1 Show resolved Hide resolved
@xingsy97 xingsy97 marked this pull request as ready for review August 24, 2022 05:57
@xingsy97 xingsy97 enabled auto-merge (squash) August 24, 2022 05:58
@xingsy97 xingsy97 changed the title Upgrade dotnet7.0 Upgrade to .NET 7 Aug 24, 2022
@xingsy97 xingsy97 disabled auto-merge August 24, 2022 05:58
@xingsy97 xingsy97 enabled auto-merge (squash) August 24, 2022 05:59
run.ps1 Show resolved Hide resolved
(Get-Content $hackTargetPath -Raw) -Replace '<VSTestArgs Include="vstest" />', '<VSTestArgs Include="test" />' | Set-Content $hackTargetPath

# Forcibly Install .NET SDK 5.0.301
$textToAdd = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this 5.0 SDK used by Tests projects? Shall we upgrade tests to net7.0 as well so we don't need to install this?

@xingsy97
Copy link
Contributor Author

xingsy97 commented Aug 26, 2022

@JialinXin

  • I encountered this error when executing build.cmd
 Failed to negotiate protocol, waiting for response timed out after 90 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout.
  Results File: D:\a\azure-signalr\azure-signalr\artifacts\logs\UnitTests-net7.0-t000.trx
  • This error can be re-produced both in github and my local environment.
  • It's caused by dotnet test/vstest rather than our own UT. Re-run cannot solve it.
  • Not found any failed unit test in log. And UT works well under VS in my local environment.
  • Upgrading only SDK itself to .NET 7 won't cause this problem. This error appeared after upgrading UT to .NET 7.
  • According to the error message, I set the the environment variable VSTEST_CONNECTION_TIMEOUT to 10000 (any large number) by executing $env:VSTEST_CONNECTION_TIMEOUT=10000 in powershell terminal and execute ./build.cmd. Then the test stuck here
  [xUnit.net 00:00:11.36]     Microsoft.Azure.SignalR.Common.Tests.Auth.AzureActiveDirectoryTests.TestAuthenticateAsync [SKIP]
  [xUnit.net 00:00:11.36]     Microsoft.Azure.SignalR.Common.Tests.Auth.AzureActiveDirectoryTests.TestGetAzureAdTokenAndAuthenticate [SKIP]
  [xUnit.net 00:00:11.36]     Microsoft.Azure.SignalR.Common.Tests.Auth.AzureActiveDirectoryTests.TestAcquireAccessToken [SKIP]
    Skipped Microsoft.Azure.SignalR.Common.Tests.Auth.AzureActiveDirectoryTests.TestAuthenticateAsync [1 ms]
    Skipped Microsoft.Azure.SignalR.Common.Tests.Auth.AzureActiveDirectoryTests.TestGetAzureAdTokenAndAuthenticate [1 ms]
    Skipped Microsoft.Azure.SignalR.Common.Tests.Auth.AzureActiveDirectoryTests.TestAcquireAccessToken [1 ms]
  [xUnit.net 00:00:20.43]     Microsoft.Azure.SignalR.Tests.TestEndpointServiceConnectionContainerTests.TestStatusPingChangesEndpointStatus [SKIP]
    Skipped Microsoft.Azure.SignalR.Tests.TestEndpointServiceConnectionContainerTests.TestStatusPingChangesEndpointStatus [1 ms]

It seems the error is not caused by insufficient VSTEST_CONNECTION_TIMEOUT. Maybe the vstest connection was already somehow broken.

  • Searched out some information but none of them helps
  1. Unable to run test. Test run getting aborted microsoft/vstest#3127
    Its author said the problem was solved by 'newer versions of the Test Platform'.

  2. https://stackoverflow.com/questions/61605460/tests-fail-to-run-after-upgrading-net-core-from-2-1-to-3-1
    It said adding package Microsoft.NET.Test.Sdk. Most of our UT projects already have this package

  3. Failed to negotiate protocol. Wait for response timeout microsoft/vstest#1607 (comment)
    It said a solution for netcoreapp2.0. I don't know how to use it.

  4. https://solveforum.com/forums/threads/solved-vstest-console-process-failed-to-connect-to-testhost-process-after-90-seconds.316059/ and https://developercommunity.visualstudio.com/t/frequent-test-failure-errorrunmessage-vstestconsol/571224
    nothing helpful

@xingsy97 xingsy97 merged commit a932b47 into Azure:dev Aug 29, 2022
xingsy97 added a commit to xingsy97/azure-signalr that referenced this pull request Sep 2, 2022
xingsy97 added a commit that referenced this pull request Sep 5, 2022
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