Avocado instrumented timeout handling in thread#6060
Avocado instrumented timeout handling in thread#6060clebergnu merged 2 commits intoavocado-framework:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6060 +/- ##
==========================================
- Coverage 68.66% 67.14% -1.53%
==========================================
Files 203 203
Lines 21970 21973 +3
==========================================
- Hits 15085 14753 -332
- Misses 6885 7220 +335 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2e40361 to
1555489
Compare
|
It would be interesting to run this with external test suites, such as the tests on QEMU or sosreport. I can attempt that as part of my review. |
|
@clebergnu ping |
clebergnu
left a comment
There was a problem hiding this comment.
Hi @richtja,
The changes look to be very effective. I've tested locally, and couldn't find any issues. Given that we are at the start of a new sprint, let's get this merged!
Please rebase it so that all CI checks pass (FYI, they all pass on my system).
|
Just for future reference, I've tested this with QEMU tests with both a job timeout: And a test timeout |
d7c0b96 to
26503d5
Compare
This commit changes the way how avocado instrumented runner handles test timeouts. For timeout handling, we used to use signals and raising TestInterrupt error. Such solution has an issue that we can't control where in the code the Error will be raised, and it can be handled before it reaches the runner layer. More info about this issue in avocado-framework#6046. This change removes the signal handling and uses threading instead. Now each test method will be run in a separated thread and this thread will be terminated if timeout is reached. This solution selves the raising error issue and keeps the current test lifecycle untouched. Reference: avocado-framework#6046 Signed-off-by: Jan Richter <jarichte@redhat.com>
cc84586 to
5a7d393
Compare
When running the matplotlib test with default configuration, we get: "UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail." This issue can cause freeze of this test on macOS. The GUI is not necessary for purpose of this test, therefore we can use non-interactive backend which will suite well for logging example. Signed-off-by: Jan Richter <jarichte@redhat.com>
5a7d393 to
1672f97
Compare
|
Hi @clebergnu, thank you for your review. All the CI checks should be passing now. I had to update matplotlib example because it had issues with the new solution on macOS. Please take a look. |
This commit changes the way how avocado instrumented runner handles test timeouts. For timeout handling, we used to use signals and raising TestInterrupt error. Such solution has an issue that we can't control where in the code the Error will be raised, and it can be handled before it reaches the runner layer. More info about this issue in #6046.
This change removes the signal handling and uses threading instead. Now each test method will be run in a separated thread and this thread will be terminated if timeout is reached. This solution selves the raising error issue and keeps the current test lifecycle untouched.
Reference: #6046