Block timeout introduction - #6031
Draft
richtja wants to merge 1 commit into
Draft
Conversation
richtja
marked this pull request as draft
September 17, 2024 16:01
richtja
force-pushed
the
multiple_timeouts
branch
2 times, most recently
from
September 18, 2024 09:03
006ca81 to
9e185ae
Compare
richtja
marked this pull request as ready for review
September 18, 2024 09:20
Contributor
Author
|
Hi @mhartmay, this is something you might be interested in, and I would like to see your opinion. Please have a look. |
This commit introduces a new timeout feature, which adds the possibility to set a specific timeout for a block of code with context manager like this: with self.wait_max(3): #code which should take max 3 seconds ... The `wait_max` method will send `SIGTERM` if the code doesn't end within 3 seconds. This signal will be caught by avocado-instrumented runner, which will interrupt the test, the same way as with a regular timeout. Reference: avocado-framework#5994 Signed-off-by: Jan Richter <jarichte@redhat.com>
richtja
force-pushed
the
multiple_timeouts
branch
from
October 2, 2024 10:24
9e185ae to
c108f3a
Compare
richtja
marked this pull request as draft
October 2, 2024 14:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a new timeout feature, which adds the possibility to set a specific timeout for a block of code with context manager like this:
The
wait_maxmethod will sendSIGALRMif the code doesn't end within 3 seconds. This signal will be caught by avocado-instrumented runner, which will interrupt the test, the same way as with a regular timeout.Reference: #5994