Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r78961:eb1030491d7b
Date: 2015-08-13 15:06 +0100
http://bitbucket.org/pypy/pypy/changeset/eb1030491d7b/

Log:    This test takes forever if the Python process is already a bit big.
        Run it in a subprocess and it's very fast.

diff --git a/rpython/rlib/rgc.py b/rpython/rlib/rgc.py
--- a/rpython/rlib/rgc.py
+++ b/rpython/rlib/rgc.py
@@ -728,9 +728,8 @@
         seen = set()
         while roots:
             gcref = roots.pop()
-            key = (type(gcref), gcref)
-            if key not in seen:
-                seen.add(key)
+            if gcref not in seen:
+                seen.add(gcref)
                 w_obj = callback(gcref)
                 if w_obj is not None:
                     result_w.append(w_obj)
diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -1,6 +1,7 @@
 import py
 import sys
 from rpython.tool.udir import udir
+from rpython.tool.version import rpythonroot
 from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.rtyper.tool import rffi_platform as platform
@@ -16,7 +17,7 @@
                                         " x86-64 CPUs for now")
 
 
-    ROOT = py.path.local(__file__).join('..')
+    ROOT = py.path.local(rpythonroot).join('rpython', 'rlib', 'rvmprof')
     SRC = ROOT.join('src')
 
 
diff --git a/rpython/rlib/rvmprof/test/test_ztranslation.py 
b/rpython/rlib/rvmprof/test/test_ztranslation.py
--- a/rpython/rlib/rvmprof/test/test_ztranslation.py
+++ b/rpython/rlib/rvmprof/test/test_ztranslation.py
@@ -1,4 +1,4 @@
-import time, os
+import time, os, sys
 from rpython.tool.udir import udir
 from rpython.rlib import rvmprof
 from rpython.translator.c.test.test_genc import compile
@@ -52,7 +52,9 @@
     return main
 
 def test_interpreted():
-    main()
+    # takes forever if the Python process is already big...
+    import subprocess
+    subprocess.check_call([sys.executable, __file__])
 
 def test_compiled():
     fn = compile(main, [], gcpolicy="minimark")
@@ -60,3 +62,8 @@
         os.unlink(PROF_FILE)
     fn()
     assert os.path.exists(PROF_FILE)
+
+if __name__ == '__main__':
+    setup_module(None)
+    res = main()
+    assert res == 0
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to