memory/gc/test/test_hook.py::TestIncMiniMarkHooks::()::test_on_gc_collect
self = <rpython.memory.gc.test.test_hook.TestIncMiniMarkHooks object at 0x00000285c553fc20>
def test_on_gc_collect(self):
from rpython.memory.gc import incminimark as m
self.gc.hooks._gc_collect_step_enabled = True
self.gc.hooks._gc_collect_enabled = True
self.malloc(S)
self.gc.collect()
assert self.gc.hooks.steps == [
{'oldstate': m.STATE_SCANNING, 'newstate': m.STATE_MARKING},
{'oldstate': m.STATE_MARKING, 'newstate': m.STATE_SWEEPING},
{'oldstate': m.STATE_SWEEPING, 'newstate': m.STATE_FINALIZING},
{'oldstate': m.STATE_FINALIZING, 'newstate': m.STATE_SCANNING}
]
assert self.gc.hooks.collects == [
{'num_major_collects': 1,
'arenas_count_before': 0,
'arenas_count_after': 0,
'arenas_bytes': 0,
'rawmalloc_bytes_after': 0,
'rawmalloc_bytes_before': 0,
'pinned_objects': 0,
}
]
assert len(self.gc.hooks.durations) == 4 # 4 steps
for d in self.gc.hooks.durations:
> assert d > 0.0
E AssertionError: assert 0.0 > 0.0
memory\gc\test\test_hook.py:110: AssertionError
builder: rpython-win-x86-64 build #404
test: memory/gc/test/test_hook/py/TestIncMiniMarkHooks/()/test_on_gc_collect