You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NCL stress tests fail to build since ProductVersion update to 8.0.0 #74604
In #61689 HttpStress and SslStress has been updated to utilize the live-built runtime with the help of targetingpacks.targets in a manner similar to our unit and functional tests.
Builds are broken since #73985: with ProductVersion still set to 7.0.0 in our tests, we get the usual framework resolution error "You must install or update .NET to run this application".
However, bumping ProductVersion in our Directory.Build.props seems to be insufficient. After setting it to 8.0.0, <testhost>/dotnet.exe exec HttpStress.dll reports the following error:
The specified framework 'Microsoft.NETCore.App', version '7.0.0-rc.1.22422.12', apply_patches=1, version_compatibility_range=patch cannot roll-forward to the previously referenced version '8.0.0'.
Note that one tricky detail is that we need to use the 7.0.0Microsoft.AspNetCore.App runtime (currently 7.0.0-rc.2.22424.4) together with the live-built Microsoft.NETCore.App.
@ViktorHofer any idea how to solve this, or what should be my next troubleshooting step? This is a high-priority issue, since we need to get stress tests running to stabilize QUIC / HTTP3.
#74157 will update the assembly versions to 8.0.0.0. I expect that change to go in soon. It sounds like that won't help you in this case as you control these versions yourself and don't import the repo infrastructure.
Builds are broken since #73985: with ProductVersion still set to 7.0.0 in our tests, we get the usual framework resolution error "You must install or update .NET to run this application".
This broke because the testhost folder path contains the $(ProductVersion) which got changed from 7.0.0 to 8.0.0. So changing your hardcoded $(ProductVersion) version is the right thing to do. Note that such hardcodes are very fragile and will break at least once per year when change the ProductVersion property.
However, bumping ProductVersion in our Directory.Build.props seems to be insufficient. After setting it to 8.0.0, /dotnet.exe exec HttpStress.dll reports the following error:
Can you please provide me a binlog so that I can take a closer look? It's hard for me to diagnose this as you have your own custom infrastructure and don't use any of the repo settings. Again this is very fragile as we might change some of these artifacts paths in the future (like the testhost path) by changing their underlying msbuild property. I would be good if you could find a more robust way to calculate inputs that you depend on.
this is very fragile as we might change some of these artifacts paths in the future (like the testhost path) by changing their underlying msbuild property
I created the current solution based on the recommendation in #60769 (comment), using targetingpacks.targets as a minimal dependency from the eng infra. If you have specific recommendations, I can try to pull in more bits of that infrastructure but then we need a robust way to copy the necessary bits to the stress test docker image (we don't copy the whole repo). However, note that we are fine with the current setup where a change in eg. Versions.props requires trivial changes from us (eg. to update our Directory.Build.props). The problem comes when we encounter unexpected issues, like in the current case where updating ProductVersion did not fix the problem for some reason.
do we use custom NuGet config? We may need to add dotnet-8 feed.....
@wfurt we don't as far as I'm aware, and I don't see how could a dotnet-8 feed feed help us. We only use 3rd party packages which should be forward-compatible with .NET 8.0.
Unfortunately, applying the changes from #74157 doesn't seem to fix this in my environment. @dotnet/area-infrastructure-libraries @dotnet/runtime-infrastructure any chance someone can help?
This is a high-priority issue, since we need to get stress tests running to stabilize QUIC / HTTP3.
Should that be happening in main or release/7.0? main has moved on from 7.0 and the failures you're seeing seem to be because not all of the product has moved forward.
My first suggestion would be to either 1) retarget the HTTP tests to 8.0 so they get the correct runtimeconfig, or 2) allow them to rollforward and run on a newer 8.0 framework. I don't think either of those would work since you're trying to do this:
use the 7.0.0 Microsoft.AspNetCore.App runtime (currently 7.0.0-rc.2.22424.4) together with the live-built Microsoft.NETCore.App.
That requirement is pretty hard since it isn't how the product works. ASP.NET doesn't allow itself to be run on a newer framework. To force it you could hack the Microsoft.AspNetCore.App.runtimeconfig.json to tell it to use 8.0.0.
The "right fix" that's inline with the product re-branding to 8.0 would be to make sure all these stress projects target 8.0 and that you have an 8.0 ASP.NET to use in them too. That's what should be happening in main.
To test against 7.0 that work should really be happening in a 7.0 branch. If that's difficult then maybe you can try the hacking suggestion I mentioned above (and in chat).
@vitek-karas@agocke - do you know of any special environment variables or anything that can let us tell the host to load a specific Microsoft.NETCore.App instead of the one listed in Microsft.ASPNetCore.App's runtimeconfig.json? Or tell the host to rollforward even though ASP.NET's runtimeconfig says not to? That might let us skirt by this point-in-time issue where the product is out of sync.
Prepate a private .NET install (don't use the global installed runtimes) which has the 8.0 NETCore.App and 7.0 ASP.NET only. Set DOTNET_ROOT to point to it, and also set DOTNET_ROLL_FORWARD=Major. Then run the test with that install. The env. variable should take precedence over anything in the .runtimeconfig.json. (The reason for the private install is that otherwise this would apply to the ASP.NET reference as well, and thus you might end up running with 8.0 ASP.NET if it's on the machine).
This is probably the cleanest solution which doesn't require hacking anything.
Disclaimer: This is a hack and I won't admit I advised its usage 😉 Make sure that the test/app has the Microsoft.NETCore.App framework reference as its first reference in the .runtimeconfig.json. Then use --fx-version command line to specify the 8.0 version - this should override anything in runtimeconfig. But it only applies to the first framework reference, thus the need for the very specific ordering in the json.
Activity
wfurt commentedon Aug 25, 2022
do we use custom NuGet config? We may need to add dotnet-8 feed.....
There were also some variables to roll forward on version.
ViktorHofer commentedon Aug 26, 2022
#74157 will update the assembly versions to 8.0.0.0. I expect that change to go in soon. It sounds like that won't help you in this case as you control these versions yourself and don't import the repo infrastructure.
This broke because the testhost folder path contains the
$(ProductVersion)which got changed from 7.0.0 to 8.0.0. So changing your hardcoded$(ProductVersion)version is the right thing to do. Note that such hardcodes are very fragile and will break at least once per year when change the ProductVersion property.Can you please provide me a binlog so that I can take a closer look? It's hard for me to diagnose this as you have your own custom infrastructure and don't use any of the repo settings. Again this is very fragile as we might change some of these artifacts paths in the future (like the testhost path) by changing their underlying msbuild property. I would be good if you could find a more robust way to calculate inputs that you depend on.
antonfirsov commentedon Aug 26, 2022
@ViktorHofer attached my binlogs:
binlogs.zip
I created the current solution based on the recommendation in #60769 (comment), using
targetingpacks.targetsas a minimal dependency from the eng infra. If you have specific recommendations, I can try to pull in more bits of that infrastructure but then we need a robust way to copy the necessary bits to the stress test docker image (we don't copy the whole repo). However, note that we are fine with the current setup where a change in eg.Versions.propsrequires trivial changes from us (eg. to update ourDirectory.Build.props). The problem comes when we encounter unexpected issues, like in the current case where updating ProductVersion did not fix the problem for some reason.antonfirsov commentedon Aug 26, 2022
@wfurt we don't as far as I'm aware, and I don't see how could a dotnet-8 feed feed help us. We only use 3rd party packages which should be forward-compatible with .NET 8.0.
runtime/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj
Lines 10 to 17 in 536f34d
antonfirsov commentedon Sep 1, 2022
Unfortunately, applying the changes from #74157 doesn't seem to fix this in my environment. @dotnet/area-infrastructure-libraries @dotnet/runtime-infrastructure any chance someone can help?
ericstj commentedon Sep 2, 2022
Should that be happening in
mainorrelease/7.0?mainhas moved on from 7.0 and the failures you're seeing seem to be because not all of the product has moved forward.My first suggestion would be to either 1) retarget the HTTP tests to 8.0 so they get the correct runtimeconfig, or 2) allow them to rollforward and run on a newer 8.0 framework. I don't think either of those would work since you're trying to do this:
That requirement is pretty hard since it isn't how the product works. ASP.NET doesn't allow itself to be run on a newer framework. To force it you could hack the
Microsoft.AspNetCore.App.runtimeconfig.jsonto tell it to use 8.0.0.The "right fix" that's inline with the product re-branding to 8.0 would be to make sure all these stress projects target 8.0 and that you have an 8.0 ASP.NET to use in them too. That's what should be happening in
main.To test against 7.0 that work should really be happening in a 7.0 branch. If that's difficult then maybe you can try the hacking suggestion I mentioned above (and in chat).
ericstj commentedon Sep 2, 2022
@vitek-karas @agocke - do you know of any special environment variables or anything that can let us tell the host to load a specific Microsoft.NETCore.App instead of the one listed in Microsft.ASPNetCore.App's runtimeconfig.json? Or tell the host to rollforward even though ASP.NET's runtimeconfig says not to? That might let us skirt by this point-in-time issue where the product is out of sync.
vitek-karas commentedon Sep 2, 2022
I can think of two ways:
Prepate a private .NET install (don't use the global installed runtimes) which has the 8.0 NETCore.App and 7.0 ASP.NET only. Set
DOTNET_ROOTto point to it, and also setDOTNET_ROLL_FORWARD=Major. Then run the test with that install. The env. variable should take precedence over anything in the.runtimeconfig.json. (The reason for the private install is that otherwise this would apply to the ASP.NET reference as well, and thus you might end up running with 8.0 ASP.NET if it's on the machine).This is probably the cleanest solution which doesn't require hacking anything.
Disclaimer: This is a hack and I won't admit I advised its usage 😉 Make sure that the test/app has the
Microsoft.NETCore.Appframework reference as its first reference in the.runtimeconfig.json. Then use--fx-versioncommand line to specify the 8.0 version - this should override anything in runtimeconfig. But it only applies to the first framework reference, thus the need for the very specific ordering in the json.antonfirsov commentedon Sep 2, 2022
Our scripts are already doing it.
Looks like this is all I needed to make this work again, thanks a lot @vitek-karas & @ericstj!
Fix NCL stress tests after ProductVersion upgrade (#75026)