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

Update SDK #47540

Merged
merged 19 commits into from
Apr 27, 2023
Merged

Update SDK #47540

merged 19 commits into from
Apr 27, 2023

Conversation

surayya-MS
Copy link
Member

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-signalr Includes: SignalR clients and servers label Apr 3, 2023
@surayya-MS
Copy link
Member Author

surayya-MS commented Apr 3, 2023

In the closed PR I changed only global.js file. There were a lot of exceptions saying "Use 'ArgumentOutOfRangeException.ThrowIfEqual' instead of explicitly throwing a new exception instance":
.https://github.com/dotnet/aspnetcore/pull/47537/files

I updated SDK and used ArgumentOutOfRangeException.ThrowIfEqual in this PR. Now checks are failing saying "'ArgumentOutOfRangeException' does not contain a definition for 'ThrowIfEqual'"

@BrennanConroy, @wtgodbe could you please help me?

@BrennanConroy
Copy link
Member

Well ThrowIfEqual doesn't even exist yet...
dotnet/runtime#83853

We should ignore the rule in our .editorconfig file and file an issue to fix it when the api exists.

@JamesNK
Copy link
Member

JamesNK commented Apr 4, 2023

Well ThrowIfEqual doesn't even exist yet... dotnet/runtime#83853

We should ignore the rule in our .editorconfig file and file an issue to fix it when the api exists.

It looks like just one warning. IMO, suppress the warning in *.cs file with a pragma. That isolate suppression to just places that have a bad warning. Add a follow-up issue to re-enable once ThrowIfEqual is available. Link to issue from cs file.

@BrennanConroy
Copy link
Member

Oh good, now Helix is using the broken version of runtime D:
dotnet/runtime#84009

@surayya-MS
Copy link
Member Author

Oh good, now Helix is using the broken version of runtime D: dotnet/runtime#84009

Thanks a lot! I've been trying to figure out what the problem was.

@surayya-MS surayya-MS requested a review from Tratcher as a code owner April 4, 2023 18:03
@@ -123,7 +123,9 @@ public override void Dispose()
}
catch (Exception ex)
{
#pragma warning disable CA2017 // Parameter count mismatch
Logger.LogWarning(0, "Failed to stop the server.", ex);
Copy link
Member

Choose a reason for hiding this comment

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

Why not fix it instead?
I assume it's supposed to be LogWarning(0, ex, "...")

Copy link
Member Author

Choose a reason for hiding this comment

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

I just tried out LogWarning(0, ex, "...") and there is no warning any more.

This is weird. Why doesn't Logger.LogWarning(0, "..", ex) work on this line but works on line 136? @BrennanConroy what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Because the warning is for {blah} arguments in the log string not matching the passed in parameters. On line 136 there is 1 argument expected in the log, and 1 argument passed in. Although, it's also wrong because the string is using $"". So we should fix it also. And looks like even more of the logs in this file are wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I will change it to LogWarning(0, ex, "...") then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you please file an issue for fixing $""? You would describe it better than me since you have more context.

Copy link
Member

Choose a reason for hiding this comment

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

It's the same change as what you're going to do for this line, move ex to be first.
Unless the analyzer breaks in that case, and then we'll probably file an issue for the analyzer.

@surayya-MS
Copy link
Member Author

surayya-MS commented Apr 4, 2023

After updating SDK to a newer version 8.0.100-preview.4.23204.1 the CA1512 suppression is no longer needed. It was the one causing warning in src/SignalR/common/Http.Connections/src/HttpConnectionDispatcherOptions.cs.

Now there is a new warning CA2017 "Number of parameters supplied in the logging message template do
not match the number of named placeholders." in \src\Hosting\Server.IntegrationTesting\src\Deployers\RemoteWindowsDep loyer\RemoteWindowsDeployer.cs. Fixed Logger.LogWarning by placing Exception before string message.

@surayya-MS surayya-MS changed the title Update SDK; use ArgumentOutOfRangeException.ThrowIfEqual instead of n… Update SDK Apr 4, 2023
@@ -108,10 +108,12 @@ public TimeSpan TransportSendTimeout
get => _transportSendTimeout;
set
{
#pragma warning disable CA1512 // Use ArgumentOutOfRangeException throw helper
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be fixable now since the APIs exist?

Copy link
Member

Choose a reason for hiding this comment

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

I tried this but it looks like they still haven't been added?

Copy link
Member

Choose a reason for hiding this comment

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

Oh that's annoying, you probably need an updated runtime as well. The APIs have definitely been added. (added 5 days ago)

Copy link
Member

Choose a reason for hiding this comment

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

Something's up with maestro, we haven't had a dependency PR opened here in 4 days. I'll post in FR (CC @dotnet/dnceng)

Copy link
Member

Choose a reason for hiding this comment

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

They're investigating (it's a timeout in darc), in the meantime I manually triggered the subscriptions.

@maraf
Copy link
Member

maraf commented Apr 27, 2023

@eerhardt since this appears to be 6.0 specific I think it is fine to quarantine it while we work on it

It's >= 6.0, the targets are shared.

@amcasey
Copy link
Member

amcasey commented Apr 27, 2023

@eerhardt since this appears to be 6.0 specific I think it is fine to quarantine it while we work on it

It's >= 6.0, the targets are shared.

I'm picking up from @eerhardt on the aspnetcore side and I'm trying to build up some context. I think @maraf just answered my question but @lewing how did we conclude this was 6.0-specific?

@amcasey
Copy link
Member

amcasey commented Apr 27, 2023

Does the publish run in parallel? I see 6 failures with the same path within 2s. Are the binlogs from tests published? I can't find them.

I think the template tests are run in parallel. At least, they muck with the port numbers to avoid conflicts, which you wouldn't expect to be necessary otherwise.

@wtgodbe
Copy link
Member

wtgodbe commented Apr 27, 2023

Are the binlogs from tests published? I can't find them.

Unfortunately we don't get access to these, the template tests run from a temp dir and clean themselves up after execution

@amcasey
Copy link
Member

amcasey commented Apr 27, 2023

Should we disable these tests (like what was done in #47920) to unblock the SDK update?

I can't tell from this thread that we think the failures are understood/acceptable enough that we'd want to sweep them under the rug by skipping several tests. Am I missing something? Is something important blocked on this PR or is this just a priority because of how far behind it is?

@lewing
Copy link
Member

lewing commented Apr 27, 2023

@eerhardt since this appears to be 6.0 specific I think it is fine to quarantine it while we work on it

It's >= 6.0, the targets are shared.

I'm picking up from @eerhardt on the aspnetcore side and I'm trying to build up some context. I think @maraf just answered my question but @lewing how did we conclude this was 6.0-specific?

There is a reason I asked other people to take a look, I just did a quick pass and clearly misread the targets. As far as disabling vs blocking do what you think is best, the right people are aware of the issue and looking into it.

@maraf
Copy link
Member

maraf commented Apr 27, 2023

I think the template tests are run in parallel. At least, they muck with the port numbers to avoid conflicts, which you wouldn't expect to be necessary otherwise.

This particular obj path is shown in 6 errors within 2s /datadisks/disk1/work/B95509FE/w/998E08AE/e/Templates/BaseFolder/AspNet.w0wr52oqxukq/Client/obj/Release/net8.0/blazor.publish.boot-extension.json. Does it mean the single test was run 6 times in parallel?

@radical
Copy link
Member

radical commented Apr 27, 2023

/datadisks/disk1/work/B95509FE/w/998E08AE/e/Templates/BaseFolder/AspNet.w0wr52oqxukq/Client/obj/Release/net8.0/blazor.publish.boot-extension.json

  • What's the root of the test project here? Is the project called AspNet.*? And is that suffix generated per test run? If so, then that should isolate the various runs.

@wtgodbe
Copy link
Member

wtgodbe commented Apr 27, 2023

@MackinnonBuck may be able to help with the template test failures

@radical
Copy link
Member

radical commented Apr 27, 2023

I think the template tests are run in parallel. At least, they muck with the port numbers to avoid conflicts, which you wouldn't expect to be necessary otherwise.

This particular obj path is shown in 6 errors within 2s /datadisks/disk1/work/B95509FE/w/998E08AE/e/Templates/BaseFolder/AspNet.w0wr52oqxukq/Client/obj/Release/net8.0/blazor.publish.boot-extension.json. Does it mean the single test was run 6 times in parallel?

@radical
Copy link
Member

radical commented Apr 27, 2023

This file is also opened by GenerateWasmBootJson but is not disposed off:

https://github.com/dotnet/runtime/blob/0f06edefe1588d27de716af5805a20ca918c5f46/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/GenerateWasmBootJson.cs#L293-L295

var config = (Dictionary<string, object>)configSerializer.ReadObject(File.OpenRead(configExtension.ItemSpec));

@maraf
Copy link
Member

maraf commented Apr 27, 2023

Good catch!

@radical
Copy link
Member

radical commented Apr 27, 2023

Preparing a fix in dotnet/runtime#85480 .

@eerhardt
Copy link
Member

eerhardt commented Apr 27, 2023

Since the fix is needed in runtime, we will have to wait for that to flow all the way to installer, and update the SDK (and take any new changes that came in the meantime). Would it make sense to disable the tests for now, until the next SDK update?

We have been trying to merge a new SDK in for a while. And need it to enable some AOT template tests.

@radical
Copy link
Member

radical commented Apr 27, 2023

A related part of this would be to not run the target twice, which would be a good thing in general. And that should fix the failure here too, if our hypothesis is indeed correct.

@radical
Copy link
Member

radical commented Apr 27, 2023

A related part of this would be to not run the target twice, which would be a good thing in general. And that should fix the failure here too, if our hypothesis is indeed correct.

Ignore me! That file is in dotnet/runtime now, so it would need the same flow!
I think we can disable the tests for now.

@wtgodbe
Copy link
Member

wtgodbe commented Apr 27, 2023

Would it make sense to disable the tests for now, until the next SDK update?

I'm supportive, but we should file an issue & link it in the build-ops handoff issue

@eerhardt eerhardt merged commit 1b78513 into dotnet:main Apr 27, 2023
@ghost ghost added this to the 8.0-preview5 milestone Apr 27, 2023
@lewing
Copy link
Member

lewing commented Apr 27, 2023

Is there someone that can reproduce this locally to manually verify the fix?

@ghost
Copy link

ghost commented Apr 27, 2023

Hi @lewing. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.