mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-120158: Fix inconsistent monitoring state when setting events too frequently (gh-141845)
If we overflowed the global version counter (i.e., after 2*24 calls to `_PyMonitoring_SetEvents`), we bailed out after setting global monitoring events but before instrumenting code objects, which led to assertion errors later on. Also add a `time.sleep()` to `test_free_threading.test_monitoring` to avoid overflowing the global version counter.
This commit is contained in:
parent
614a28b3da
commit
e457d60daa
3 changed files with 6 additions and 1 deletions
|
|
@ -73,6 +73,9 @@ def test_instrumentation(self):
|
|||
break
|
||||
|
||||
self.during_threads()
|
||||
# Sleep to avoid setting monitoring events too rapidly and
|
||||
# overflowing the global version counter
|
||||
time.sleep(0.0001)
|
||||
|
||||
self.after_test()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue