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

Add graceful stop specs #6103

Merged
merged 3 commits into from
Sep 17, 2022

Conversation

Aaronontheweb
Copy link
Member

Changes

Adding some unit tests for GracefulStop since apparently we've never had any dedicated tests for this in the test suite. This is in preparation for some changes I'm going to introduce in #6102

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):


private class CustomShutdown{}

[Fact(DisplayName = "GracefulStop should return false if shutdown goes overtime", Skip = "GracefulStop currently throws a TaskCancellationException, which seems 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.

Marked this test as Skipped for now - going to change that in #6102

This API is wrong. We shouldn't throw an Exception if graceful stop fails to complete on-time - we should simply return false. Otherwise there's no point to having a return value at all.

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) September 17, 2022 16:44
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) September 17, 2022 16:44
@Aaronontheweb
Copy link
Member Author

All of the tests passed but the .NET test runner hit the deck:

Written 699301888 bytes (170728 pages) to core file
The active test run was aborted. Reason: Test host process crashed
Data collector 'Blame' message: Could not start process dump: System.PlatformNotSupportedException: Unsupported operating system: Linux 5.4.0-1086-azure #91~18.04.1-Ubuntu SMP Thu Jun 23 20:33:05 UTC 2022, and framework: .NETCoreApp,Version=v3.1.
   at Microsoft.TestPlatform.Extensions.BlameDataCollector.CrashDumperFactory.Create(String targetFramework)
   at Microsoft.TestPlatform.Extensions.BlameDataCollector.ProcessDumpUtility.CrashDump(Int32 processId, String tempDirectory, DumpTypeOption dumpType, String targetFramework, Boolean collectAlways)
   at Microsoft.TestPlatform.Extensions.BlameDataCollector.ProcessDumpUtility.StartTriggerBasedProcessDump(Int32 processId, String testResultsDirectory, Boolean isFullDump, String targetFramework, Boolean collectAlways)
   at Microsoft.TestPlatform.Extensions.BlameDataCollector.BlameCollector.TestHostLaunchedHandler(Object sender, TestHostLaunchedEventArgs args).
Data collector 'Blame' message: The specified inactivity time of 30 seconds has elapsed. Collecting hang dumps from testhost and its child processes.
Results File: /home/vsts/work/1/s/TestResults/_fv-az376-119_2022-09-17_16_45_43.trx

@Aaronontheweb Aaronontheweb merged commit daa2b9b into akkadotnet:dev Sep 17, 2022
@Aaronontheweb Aaronontheweb deleted the add-GracefulStopSpecs branch September 17, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant