[pypy-commit] pypy default: Try 20x in this test too.

arigo noreply at buildbot.pypy.org
Mon Sep 5 15:52:15 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r47082:54a2d8fd87be
Date: 2011-09-05 15:51 +0200
http://bitbucket.org/pypy/pypy/changeset/54a2d8fd87be/

Log:	Try 20x in this test too.

diff --git a/pypy/objspace/std/test/test_methodcache.py b/pypy/objspace/std/test/test_methodcache.py
--- a/pypy/objspace/std/test/test_methodcache.py
+++ b/pypy/objspace/std/test/test_methodcache.py
@@ -88,30 +88,37 @@
   
     def test_many_names(self):
         import __pypy__
-        class A(object):
-            foo = 5
-            bar = 6
-            baz = 7
-            xyz = 8
-            stuff = 9
-            a = 10
-            foobar = 11
+        for j in range(20):
+            class A(object):
+                foo = 5
+                bar = 6
+                baz = 7
+                xyz = 8
+                stuff = 9
+                a = 10
+                foobar = 11
 
-        a = A()
-        names = [name for name in A.__dict__.keys()
-                      if not name.startswith('_')]
-        names.sort()
-        names_repeated = names * 10
-        result = []
-        __pypy__.reset_method_cache_counter()
-        for name in names_repeated:
-            result.append(getattr(a, name))
-        append_counter = __pypy__.method_cache_counter("append")
-        names_counters = [__pypy__.method_cache_counter(name)
-                          for name in names]
-        assert append_counter[0] >= 5 * len(names)
-        for name, count in zip(names, names_counters):
-            assert count[0] >= 5, str((name, count))
+            a = A()
+            names = [name for name in A.__dict__.keys()
+                          if not name.startswith('_')]
+            names.sort()
+            names_repeated = names * 10
+            result = []
+            __pypy__.reset_method_cache_counter()
+            for name in names_repeated:
+                result.append(getattr(a, name))
+            append_counter = __pypy__.method_cache_counter("append")
+            names_counters = [__pypy__.method_cache_counter(name)
+                              for name in names]
+            try:
+                assert append_counter[0] >= 10 * len(names) - 1
+                for name, count in zip(names, names_counters):
+                    assert count == (9, 1), str((name, count))
+                break
+            except AssertionError:
+                pass
+        else:
+            raise
 
     def test_mutating_bases(self):
         class C(object):


More information about the pypy-commit mailing list