avocado icon indicating copy to clipboard operation
avocado copied to clipboard

Block timeout introduction

Open richtja opened this issue 5 months ago • 1 comments

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 SIGALRM 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: #5994

richtja avatar Sep 17 '24 15:09 richtja