projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test_try_again_many_times(): use three times `None`'s ref count
[babeltrace.git]
/
tests
/
bindings
/
python
/
bt2
/
test_message_iterator.py
diff --git
a/tests/bindings/python/bt2/test_message_iterator.py
b/tests/bindings/python/bt2/test_message_iterator.py
index 3cd27e5b77325536a7c8735756edd539bf76ec01..31f4192126d33940bc28bd7eefb665d50c68351f 100644
(file)
--- a/
tests/bindings/python/bt2/test_message_iterator.py
+++ b/
tests/bindings/python/bt2/test_message_iterator.py
@@
-21,6
+21,7
@@
import collections
import unittest
import copy
import bt2
import unittest
import copy
import bt2
+import sys
from utils import TestOutputPortMessageIterator
from utils import TestOutputPortMessageIterator
@@
-405,10
+406,12
@@
class UserMessageIteratorTestCase(unittest.TestCase):
src = graph.add_component(MySource, 'src')
it = TestOutputPortMessageIterator(graph, src.output_ports['out'])
src = graph.add_component(MySource, 'src')
it = TestOutputPortMessageIterator(graph, src.output_ports['out'])
- # Th
e initial refcount of Py_None was in the 7000, so 100000 iterations
- #
should
be enough to catch the bug even if there are small differences
+ # Th
ree times the initial ref count of `None` iterations should
+ # be enough to catch the bug even if there are small differences
# between configurations.
# between configurations.
- for i in range(100000):
+ none_ref_count = sys.getrefcount(None) * 3
+
+ for i in range(none_ref_count):
with self.assertRaises(bt2.TryAgain):
next(it)
with self.assertRaises(bt2.TryAgain):
next(it)
This page took
0.025461 seconds
and
4
git commands to generate.