[pypy-commit] pypy stmgc-c7: Fix test

arigo noreply at buildbot.pypy.org
Sat Feb 21 18:32:44 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r76034:58200123718c
Date: 2015-02-21 18:32 +0100
http://bitbucket.org/pypy/pypy/changeset/58200123718c/

Log:	Fix test

diff --git a/rpython/translator/stm/test/test_ztranslated.py b/rpython/translator/stm/test/test_ztranslated.py
--- a/rpython/translator/stm/test/test_ztranslated.py
+++ b/rpython/translator/stm/test/test_ztranslated.py
@@ -1,6 +1,6 @@
 import py
 from rpython.rlib import rstm, rgc, objectmodel
-from rpython.rlib.debug import debug_print
+from rpython.rlib.debug import debug_start, debug_print, debug_stop
 from rpython.rlib.rarithmetic import intmask
 from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
 from rpython.rtyper.lltypesystem.lloperation import llop
@@ -280,7 +280,9 @@
             if retry_counter < 1000:
                 if (retry_counter & 3) == 0:
                     lltype.free(x, flavor='raw')
+                debug_start('foo')
                 debug_print(rffi.cast(lltype.Signed, x))
+                debug_stop('foo')
                 rstm.abort_and_retry()
             lltype.free(x, flavor='raw')
             return 0
@@ -295,10 +297,14 @@
             return 0
 
         t, cbuilder = self.compile(main)
-        data, dataerr = cbuilder.cmdexec('', err=True)
-        lines = dataerr.split('\n')
-        assert len(lines) > 1000
-        addresses = map(int, lines[:1000])
+        data, dataerr = cbuilder.cmdexec('', err=True, env={'PYPYLOG': 'foo:-'})
+        lines = dataerr.splitlines()
+        assert len(lines) > 3000
+        addresses = []
+        for i in range(0, 3000, 3):
+            assert lines[i].endswith('{foo')
+            addresses.append(int(lines[i+1].split()[-1]))
+            assert lines[i+2].endswith('foo}')
         assert len(addresses) == 1000
         assert len(set(addresses)) < 500    # should ideally just be a few
         import re


More information about the pypy-commit mailing list