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

WebScenarioTests smoke tests fail on mono with unexpected exit code. #3174

Closed
tmds opened this issue Dec 13, 2022 · 6 comments · Fixed by dotnet/sdk#42209
Closed

WebScenarioTests smoke tests fail on mono with unexpected exit code. #3174

tmds opened this issue Dec 13, 2022 · 6 comments · Fixed by dotnet/sdk#42209
Labels
area-testing Improvements in CI and testing

Comments

@tmds
Copy link
Member

tmds commented Dec 13, 2022

From the log:

[xUnit.net 00:00:55.38]         Executing: kill -s TERM 108304
    Failed Microsoft.DotNet.SourceBuild.SmokeTests.WebScenarioTests.VerifyScenario(scenario: TestScenario { Commands = Build | Run | Publish, Language = CSharp, NoHttps = False, ScenarioName = "WebScenarioTests", Template = BlazorWasm }) [54 s]
EXEC : error Message:  [/home/tester/dotnet/build.proj]
     System.InvalidOperationException : Failed to execute /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/.dotnet/dotnet run /bl:/home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/logs/WebScenarioTests_BlazorWasm_CSharp-run.binlog
  Exit code: 143
  Building...
  info: Microsoft.Hosting.Lifetime[14]
        Now listening on: http://localhost:5199/
  info: Microsoft.Hosting.Lifetime[0]
        Application started. Press Ctrl+C to shut down.
  info: Microsoft.Hosting.Lifetime[0]
        Hosting environment: Development
  info: Microsoft.Hosting.Lifetime[0]
        Content root path: /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/projects-202212131302478513/WebScenarioTests_BlazorWasm_CSharp
  
    Stack Trace:
       at Microsoft.DotNet.SourceBuild.SmokeTests.ExecuteHelper.ValidateExitCode(ValueTuple`3 result, Int32 expectedExitCode) in /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/ExecuteHelper.cs:line 124
     at Microsoft.DotNet.SourceBuild.SmokeTests.DotNetHelper.ExecuteCmd(String args, String workingDirectory, Action`1 additionalProcessConfigCallback, Nullable`1 expectedExitCode, Int32 millisecondTimeout) in /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs:line 109
     at Microsoft.DotNet.SourceBuild.SmokeTests.DotNetHelper.ExecuteRunWeb(String projectName) in /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs:line 201
     at Microsoft.DotNet.SourceBuild.SmokeTests.TestScenario.Execute(DotNetHelper dotNetHelper) in /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/TestScenario.cs:line 38
     at Microsoft.DotNet.SourceBuild.SmokeTests.WebScenarioTests.VerifyScenario(TestScenario scenario) in /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/WebScenarioTests.cs:line 23
     at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
     at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    Standard Output Messages:
   Executing: /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/.dotnet/dotnet new blazorwasm --name WebScenarioTests_BlazorWasm_CSharp --output /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/projects-202212131302478513/WebScenarioTests_BlazorWasm_CSharp --language "C#" 
   Executing: /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/.dotnet/dotnet build /bl:/home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/logs/WebScenarioTests_BlazorWasm_CSharp-build.binlog
   Executing: /home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/.dotnet/dotnet run /bl:/home/tester/dotnet/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net7.0/logs/WebScenarioTests_BlazorWasm_CSharp-run.binlog
   Executing: kill -s TERM 108304

This test expects 0 as an exit value of dotnet run after sending SIGTERM to it.
However the exit code is 143, which is the expected exit code for a process that gets killed with SIGTERM but doesn't handle it.

It can be reproduced easily with a mono sdk by sending SIGTERM to a dotnet run process that is running the web template.

The exit code for this process is 143 with a mono runtime, and 0 with a coreclr runtime.

Has someone run this test on mono before? Did it ever pass?

cc @omajid @crummel @MichaelSimons

@dotnet-issue-labeler dotnet-issue-labeler bot added area-testing Improvements in CI and testing untriaged labels Dec 13, 2022
@MichaelSimons
Copy link
Member

Has someone run this test on mono before? Did it ever pass?

I would guess not since we don't have mono CI.

@tmds
Copy link
Member Author

tmds commented Dec 14, 2022

@omajid @uweigand I assume you haven't ran the smoke tests with mono based builds either?

I'll report an issue for it in dotnet/runtime.
Until the difference gets fixed, I'd like to update the test so it also passes with mono.

@uweigand
Copy link

@omajid @uweigand I assume you haven't ran the smoke tests with mono based builds either?

I ran them on .NET6, but not yet on .NET7. I haven't seen this issue back then.

@MichaelSimons
Copy link
Member

[Triage] #2596 tracks adding a mono configuration to CI.

@MichaelSimons
Copy link
Member

@tmds - Is this issue still applicable? You enabled CI on Mono with #2596 but I still see dotnet/runtime#81093 is still active. What am I missing?

@tmds
Copy link
Member Author

tmds commented Jun 1, 2023

We've updated the test suite to account for the Mono behavior.

When the fix is merged in the runtime repo, the suite will fail again, and we have to undo those changes.

akoeplinger added a commit to dotnet/sdk that referenced this issue Jul 17, 2024
The mono issue that caused the different exit code was fixed in dotnet/runtime#100056.

We now have the same exit code as coreclr so remove the mono special case.

Fixes dotnet/source-build#3174
Fixes dotnet/source-build#4514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing Improvements in CI and testing
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants