Skip to content

NCL stress tests fail to build since ProductVersion update to 8.0.0 #74604

Closed

Description

@antonfirsov

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.0 Microsoft.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.

Activity

  1. self-assigned this
    on Aug 25, 2022
  2. ghost added
    untriaged
    on Aug 25, 2022
  3. wfurt commented on Aug 25, 2022

    @wfurt
    Member

    do we use custom NuGet config? We may need to add dotnet-8 feed.....
    There were also some variables to roll forward on version.

  4. added this to the 8.0.0 milestone on Aug 25, 2022
  5. ghost removed
    untriaged
    on Aug 25, 2022
  6. added
    test-bug
    on Aug 25, 2022
  7. ViktorHofer commented on Aug 26, 2022

    @ViktorHofer
    Member

    #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.

  8. antonfirsov commented on Aug 26, 2022

    @antonfirsov
    ContributorAuthor

    @ViktorHofer attached my binlogs:
    binlogs.zip

    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.

  9. antonfirsov commented on Aug 26, 2022

    @antonfirsov
    ContributorAuthor

    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.

    <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.ObjectPool" Version="5.0.9" />
    <PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
    <PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />
    <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
    <PackageReference Include="System.CommandLine.Experimental" Version="0.3.0-alpha.19577.1" />
    <PackageReference Include="System.Net.Http.WinHttpHandler" Version="4.5.4" />
    </ItemGroup>

  10. antonfirsov commented on Sep 1, 2022

    @antonfirsov
    ContributorAuthor

    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?

  11. ericstj commented on Sep 2, 2022

    @ericstj
    Member

    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).

  12. ericstj commented on Sep 2, 2022

    @ericstj
    Member

    @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.

  13. vitek-karas commented on Sep 2, 2022

    @vitek-karas
    Member

    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_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.

  14. antonfirsov commented on Sep 2, 2022

    @antonfirsov
    ContributorAuthor

    Prepate a private .NET install

    Our scripts are already doing it.

    and also set DOTNET_ROLL_FORWARD=Major

    Looks like this is all I needed to make this work again, thanks a lot @vitek-karas & @ericstj!

  15. ghost added
    in-pr
    on Sep 2, 2022
  16. added a commit that references this issue on Sep 5, 2022
    5eead36
  17. ghost removed
    in-pr
    on Sep 5, 2022
  18. ghost locked as resolved and limited conversation to collaborators on Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Nettest-bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions