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

[Housekeeping] Fix The active test run was aborted. Reason: Test host process crashed #2206

Conversation

TheCodeTraveler
Copy link
Collaborator

@TheCodeTraveler TheCodeTraveler commented Sep 12, 2024

Description of Change

This PR hopefully fixes the random crashing of the Unit Test host process in our CI/CD pipeline:

The active test run was aborted. Reason: Test host process crashed

The VS Test team has added a new Environment Variable, VSTEST_TESTHOST_SHUTDOWN_TIMEOUT , that we can leverage to extend the test runner timeout: https://github.com/microsoft/vstest/blob/02a8ba17b12757e0787b5e787b17533f21432b16/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs#L330.

This PR increases the value of VSTEST_TESTHOST_SHUTDOWN_TIMEOUT from its default of 100ms to 11000ms to exceed our longest defined timeout, BaseTest.TestDuration.Long = 10000.

Additional information

Source for VSTEST_TESTHOST_SHUTDOWN_TIMEOUT information: microsoft/vstest#2952 (comment)

This PR also fixes the crashing test process in DrawingViewTests. The crashes were caused by injecting ViewHandler.ViewMapper into MockDrawingViewHandler.DrawingViewPropertyMapper.

I also used dotnet format to ensure we're using CollectionExpressions in each place where we can utilize them to take advantage of their performance benefits.

@TheCodeTraveler
Copy link
Collaborator Author

TheCodeTraveler commented Sep 12, 2024

Oh fun - the pipeline is now failing with a new error:

The active test run was aborted. Reason: Test host process crashed : Stack overflow.

https://dev.azure.com/dotnet/CommunityToolkit/_build/results?buildId=109663&view=logs&j=3f96dcf5-6e1e-5485-3200-c557d5216be3&t=12286b69-c788-55db-0a8c-ef899858fbe6&l=76

@TheCodeTraveler TheCodeTraveler marked this pull request as draft September 12, 2024 19:10
@TheCodeTraveler
Copy link
Collaborator Author

TheCodeTraveler commented Sep 12, 2024

/azp run

Edit: Success 🎉

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

This comment was marked as off-topic.

@TheCodeTraveler
Copy link
Collaborator Author

TheCodeTraveler commented Sep 12, 2024

/azp run

Edit: Success 🎉

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

This comment was marked as off-topic.

@TheCodeTraveler
Copy link
Collaborator Author

@bijington This may finally solve it! 🤞

I've now had two successful pipeline runs with no errors.

I'll change this PR from Draft to Ready to Review now, and run our pipeline one more time. If it passes again, hopefully, we're good!

@TheCodeTraveler
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TheCodeTraveler TheCodeTraveler marked this pull request as ready for review September 12, 2024 19:51
@bijington
Copy link
Contributor

@bijington This may finally solve it! 🤞

I've now had two successful pipeline runs with no errors.

I'll change this PR from Draft to Ready to Review now, and run our pipeline one more time. If it passes again, hopefully, we're good!

Third time unlucky 😭

@TheCodeTraveler
Copy link
Collaborator Author

Dang - back to the drawing board...

@TheCodeTraveler TheCodeTraveler marked this pull request as draft September 12, 2024 20:32
@TheCodeTraveler TheCodeTraveler removed the request for review from bijington September 12, 2024 20:32
@bijington
Copy link
Contributor

Dang - back to the drawing board...

Who needs tests anyway... 🤣

@TheCodeTraveler
Copy link
Collaborator Author

TheCodeTraveler commented Sep 12, 2024

One Success! Let's try it again.

This comment was marked as off-topic.

@TheCodeTraveler
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TheCodeTraveler
Copy link
Collaborator Author

Two success!

@TheCodeTraveler
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TheCodeTraveler
Copy link
Collaborator Author

3 successes! 🚀

@bijington - let's try this one more time. I'll switch to Ready for Review and run the pipeline once more.

@TheCodeTraveler TheCodeTraveler marked this pull request as ready for review September 12, 2024 23:53
@TheCodeTraveler
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TheCodeTraveler TheCodeTraveler changed the title [Housekeeping] Define VSTEST_TESTHOST_SHUTDOWN_TIMEOUT Environment Variable [Housekeeping] Fix The active test run was aborted. Reason: Test host process crashed Sep 13, 2024
@TheCodeTraveler TheCodeTraveler enabled auto-merge (squash) September 13, 2024 19:39
@TheCodeTraveler TheCodeTraveler merged commit dfd8ed8 into main Sep 13, 2024
8 checks passed
@TheCodeTraveler TheCodeTraveler deleted the Define-`VSTEST_TESTHOST_SHUTDOWN_TIMEOUT`-Environment-Variable branch September 13, 2024 19:39
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants