Message132975
I wrote the assertion while dump_tracebacks_later() was implemented using SIGALRM + alarm(timeout). A simple fix for this issue is just to remove the assertion. But... I'm curious, and I would like to understand.
The problem is on the following code:
timeout = 0.5
pause = timeout * 2.5
# on Windows XP, b-a gives 1.249931 after sleep(1.25)
min_pause = pause * 0.9
a = time.time()
time.sleep(pause)
b = time.time()
faulthandler.cancel_dump_tracebacks_later()
# Check that sleep() was not interrupted
assert (b - a) >= min_pause, "{{}} < {{}}".format(b - a, min_pause)
So time.sleep(1.25) gives a time delta of 0.998 or 0.970 seconds. Hum, this value is close to 1.0 seconds, but not to 1.25 seconds.
I see different reasons why the assertion may fail:
* sleep() was really interrupted (by faulthandler thread writing the tracebacks?)
* time.time() and/or sleep() are not accurate on Windows XP |
|
Date |
User |
Action |
Args |
2011-04-04 21:31:40 | vstinner | set | recipients:
+ vstinner, belopolsky, pitrou |
2011-04-04 21:31:40 | vstinner | set | messageid: <1301952700.38.0.0566976914657.issue11765@psf.upfronthosting.co.za> |
2011-04-04 21:31:37 | vstinner | link | issue11765 messages |
2011-04-04 21:31:37 | vstinner | create | |
|