Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_getframe.py::TestGetFrame::()::test_current_frames

self = <pypy.module.pypyjit.test_pypy_c.test_getframe.TestGetFrame object at 0x000001f1bfd90170>

    def test_current_frames(self):
        def main():
            import sys
            import time
            import thread
    
            lst = [0.0] * 1000
            lst[-33] = 3.0
            done = []
    
            def h1(x):
                time.sleep(lst[x])
    
            def g1(x):
                h1(x)
    
            def f1():
                for j in range(1000):
                    g1(j)
                done.append('done')
    
            for k in range(3):
                thread.start_new_thread(f1, ())
    
            time.sleep(1)
            d = sys._current_frames()
    
            time.sleep(3)
            # the captured frames should be finished by now
    
            done.append(str(len(d)))
            for key, value in d.items():
                while value is not None:
                    name = value.f_code.co_name
                    if len(name) == 2 and name[1] == '1':
                        done.append(name)
                    value = value.f_back
            return repr('-'.join(done))
    
        log = self.run(main, [])
>       assert log.result == 'done-done-done-4-h1-g1-f1-h1-g1-f1-h1-g1-f1'
E       assert '4-h1-g1-f1-h1-g1-f1-h1-g1-f1' == 'done-done-don...1-f1-h1-g1-f1'
E         - 4-h1-g1-f1-h1-g1-f1-h1-g1-f1
E         + done-done-done-4-h1-g1-f1-h1-g1-f1-h1-g1-f1
E         ? +++++++++++++++

pypy\module\pypyjit\test_pypy_c\test_getframe.py:67: AssertionError
builder: pypy-c-jit-win-x86-64 build #2372+
test: pypy/module/pypyjit/test_pypy_c/test_getframe.py::TestGetFrame::()::test_current_frames