-
Notifications
You must be signed in to change notification settings - Fork 321
Fail tests that run for more than 10 minutes #3906
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements per-test timeout enforcement by adding xUnit's --blame-hang options to all test execution commands. The goal is to identify tests that hang and exceed a 10-minute threshold, preventing them from wasting pipeline execution time.
Changes:
- Added
--blame-hang,--blame-hang-dump-type none, and--blame-hang-timeout 10marguments to all test execution tasks - Refactored test command arguments to use multi-line YAML format for better readability
- Added missing
command: buildparameter to DotNetCoreCLI@2 task in configure-sql-server-step.yml
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/pipelines/common/templates/steps/configure-sql-server-step.yml | Added missing command: build parameter to DotNetCoreCLI@2 task (unrelated fix) |
| eng/pipelines/common/templates/steps/build-and-run-tests-netfx-step.yml | Added blame-hang timeout options to all 4 .NET Framework test tasks and reformatted arguments for readability |
| eng/pipelines/common/templates/steps/build-and-run-tests-netcore-step.yml | Added blame-hang timeout options to all 4 .NET Core test tasks and reformatted arguments for readability |
| build.proj | Added blame-hang timeout options to all 6 test targets (Unit/Functional/Manual for both Windows and Unix) |
Just FYI, |
benrr101
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, I thought it would be pretty easy to implement 🚢
- Generating full dumps for hung tests that are killed.
|
@vonzshik - Interesting. This article seems to show the test and stack: https://www.meziantou.net/generating-a-dump-file-when-tests-hang-on-a-ci-machine.htm I've enabled full dumps anyway, and confirmed that we are publishing any dumps/sequence files after the test runs so we will be able to view/analyze them. |
|
@paulmedynski the stacktrace there is useless because it's for the host, not for a specific test. When I last tried it using
As for debugging the dump, from my understanding that's only supported for full dumps (you do have them enabled), but the last time I tried debugging it, I didn't managed to go that far because there wasn't any actual thread being stuck (I guess instead it was a stuck async task). |
|
We had a hung test, and the output looks promising: I'll take a look at the dump and sequence files to see if they match the test that was running |
|
Wonder whether it's because it's running on windows and not linux... |
- Changed test results publishing to occur regardless of Project vs Package references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
eng/pipelines/common/templates/steps/build-and-run-tests-netcore-step.yml
Show resolved
Hide resolved
eng/pipelines/common/templates/steps/build-and-run-tests-netcore-step.yml
Outdated
Show resolved
Hide resolved
eng/pipelines/common/templates/steps/build-and-run-tests-netcore-step.yml
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpTest.cs
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #3906 +/- ##
==========================================
- Coverage 76.90% 67.62% -9.29%
==========================================
Files 269 263 -6
Lines 43246 66170 +22924
==========================================
+ Hits 33260 44746 +11486
- Misses 9986 21424 +11438
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|


Description
Individual tests should never run for more than 10 minutes. We currently have some stubborn tests that occasionally hang forever, but the current xUnit output doesn't tell us which tests they are. This will reveal them, and prevent future hanging tests from wasting pipeline run time.
I'll move any offending tests into the Flaky category as part of this PR.
Testing
Normal PR/CI runs will reveal the problem tests and determine if 10 minutes is a suitable per-test timeout.