-
Notifications
You must be signed in to change notification settings - Fork 751
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
[master] Switch to Windows Server queues #2927
Conversation
dougbu
commented
Feb 3, 2020
- agents should start much faster
@@ -42,7 +42,7 @@ public void RunTest_Win10_RS4() | |||
Assert.NotNull(versionKey); | |||
var currentVersion = (string)versionKey.GetValue("CurrentBuildNumber"); | |||
Assert.NotNull(currentVersion); | |||
Assert.True(17134 >= int.Parse(currentVersion)); | |||
Assert.True(17134 >= int.Parse(currentVersion), $"Unexpected build number {currentVersion} on {Environment.OSVersion}."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MattGal this displays very strange information when the assertion fails:
Unexpected build number 17763 on Microsoft Windows NT 6.2.9200.0.
But, according to https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions, 17763
is the build number of the latest Windows Server 2019 release. But, 6.2.9200.0
indicates the agent is running Windows Server 2012 (not R2) and 9200
is the build number of the latest release there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I need to revise our testing attributes to handle server machines and get them working in the new world. Right now they seem to work as expected only for the client OS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagging @Tratcher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment.OSVersion
lies for back-compat reasons unless you have an app manifest. VS and dotnet test both have manifests so that's not usually a problem?
What version did this queue use to run on?
Maybe server 2019 has a new manifest guid?
https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Tratcher said. From our perspective though, whenever we say server we are aiming for "latest non-core fully patched server as of when the image was generated" now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being current is great, we just need to figure out why our version detection broke.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the app manifest docs only go up to Server 2016, I can't find any information about 2019.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The owners of the app manifest docs claim the GUID is unchanged for server 2019. Might have to set up some machines and confirm.
MicrosoftDocs/feedback#2477 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it used the same GUID, these tests wouldn't have failed and we wouldn't see 6.2.9200.0
src/TestingUtils/Microsoft.AspNetCore.Testing/test/MaximumOSVersionTest.cs
Outdated
Show resolved
Hide resolved
@@ -42,7 +42,7 @@ public void RunTest_Win10_RS4() | |||
Assert.NotNull(versionKey); | |||
var currentVersion = (string)versionKey.GetValue("CurrentBuildNumber"); | |||
Assert.NotNull(currentVersion); | |||
Assert.True(17134 >= int.Parse(currentVersion)); | |||
Assert.True(17134 >= int.Parse(currentVersion), $"Unexpected build number {currentVersion} on {Environment.OSVersion}."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment.OSVersion
lies for back-compat reasons unless you have an app manifest. VS and dotnet test both have manifests so that's not usually a problem?
What version did this queue use to run on?
Maybe server 2019 has a new manifest guid?
https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
All: If the problem is the manifests and we had the GUID, we could contribute a PR that updates files like https://github.com/microsoft/vstest/blob/master/src/testhost.x86/app.manifest and https://github.com/microsoft/vstest/blob/master/src/vstest.console/app.manifest Those files currently list the So, @Pilchie do we have any contacts on the Windows Server team? Another option is to stick w/ the Windows.10 queues in all repos x branches using Or, @MattGal do we have any queues running Windows Server 2016? |
I also filed MicrosoftDocs/feedback#2477 to help track this down. |
The OS is always known to lie about version. See https://devblogs.microsoft.com/oldnewthing/20100927-00/?p=12733 and it's linked articles for some of the reasons why. AFAIK, the way to get new OS versions to be returned is to compile with a newer Windows SDK. We should start an internal thread with some contacts to figure out what to do here. Also, I hear that dotnet/runtime has similar test attributes, we should look at how they work. |
I suspect the relevant dotnet/runtime class is the Windows portion of Then again, /cc @stephentoub and @ViktorHofer (feel free to take this offline). We're trying to get our testing attributes to treat Windows Server 2019 as if it were Windows 10 but don't have the right manifest to do it with our current approach. See Any suggestions much appreciated❕ |
- wait for unblock of dotnet#2927 - however, do switch to VS2019 queues
- wait for unblock of dotnet#2927
50cac19
to
28dd096
Compare
I wasn't able to reproduce this issue locally using the current master. I set up a Win Server 2019 VM and the tests passed fine. Another app worked fine with the normal Win10 app manifest.
Doug, I rebased your changes on master to see if anything has changed. |
Nope, still failing. Interesting observation though, it's only failing on the net472 target, Core is fine.
@MattGal any chance of getting access to one of these agents to debug this more? |
Set @Tratcher up on teams with a machine using this image, he'll report back with findings. |
Progress, I was able to repro this locally on Server 2019.
Found it: dotnet msbuild -target:test` uses a different test runner on core and .net. On core it uses dotnet.exe, but on .net it uses xunit.console.exe. Unpacked success command:
Unpacked failure command:
dotnet.exe has a manifest that opts into Win10 support. xunit.console.exe by comparison doesn't have any compat information in its manifest. Why don't these tests fail on other Win10 queues? Theory: This is our first queue that uses RS4 or later. There aren't any Win10 tests for lower versions. |
Sounds reasonable. Should we switch to use the |
Let's start by skipping this test on .NET. The attribute isn't currently used for any .NET scenarios, only Core. I'll update the PR. Second, I'll file a bug on xunit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@JunTaoLuo @maryamariyan FYI our |
- add debug information for `Assert` failures in `MaximumOSVersionTest` - update src/TestingUtils/Microsoft.AspNetCore.Testing/test/MaximumOSVersionTest.cs - co-Authored-By: @Tratcher - try with VS2019 queues - skip `MaximumOSVersion` tests on .NET due to xunit issue - co-authored-by: @Tratcher Commit migrated from dotnet/extensions@26ff835
Related: dotnet/runtime#33643 |
- add debug information for `Assert` failures in `MaximumOSVersionTest` - update src/TestingUtils/Microsoft.AspNetCore.Testing/test/MaximumOSVersionTest.cs - co-Authored-By: @Tratcher - try with VS2019 queues - skip `MaximumOSVersion` tests on .NET due to xunit issue - co-authored-by: @Tratcher Commit migrated from dotnet/extensions@26ff835
- add debug information for `Assert` failures in `MaximumOSVersionTest` - update src/TestingUtils/Microsoft.AspNetCore.Testing/test/MaximumOSVersionTest.cs - co-Authored-By: @Tratcher - try with VS2019 queues - skip `MaximumOSVersion` tests on .NET due to xunit issue - co-authored-by: @Tratcher Commit migrated from dotnet/extensions@26ff835