[pypy-commit] pypy py3k: Make these tests, which rely on the GIL being released, more reliable.

mjacob noreply at buildbot.pypy.org
Wed Jun 3 23:57:13 CEST 2015


Author: Manuel Jacob <me at manueljacob.de>
Branch: py3k
Changeset: r77846:f64ff1e27a9b
Date: 2015-06-03 23:57 +0200
http://bitbucket.org/pypy/pypy/changeset/f64ff1e27a9b/

Log:	Make these tests, which rely on the GIL being released, more
	reliable.

	This is necessary on this branch because the GIL semantics changed.

diff --git a/pypy/module/__pypy__/test/test_signal.py b/pypy/module/__pypy__/test/test_signal.py
--- a/pypy/module/__pypy__/test/test_signal.py
+++ b/pypy/module/__pypy__/test/test_signal.py
@@ -57,10 +57,10 @@
                 interrupted = []
                 print('--- start ---')
                 _thread.start_new_thread(subthread, ())
-                for j in range(30):
+                for j in range(100):
                     if len(done): break
                     print('.')
-                    time.sleep(0.25)
+                    time.sleep(0)
                 print('main thread loop done')
                 assert len(done) == 1
                 assert len(interrupted) == 1
diff --git a/pypy/module/select/test/test_select.py b/pypy/module/select/test/test_select.py
--- a/pypy/module/select/test/test_select.py
+++ b/pypy/module/select/test/test_select.py
@@ -287,7 +287,7 @@
             t = thread.start_new_thread(pollster.poll, ())
             try:
                 time.sleep(0.3)
-                for i in range(5): print(''),  # to release GIL untranslated
+                for i in range(100): print(''),  # to release GIL untranslated
                 # trigger ufds array reallocation
                 for fd in rfds:
                     pollster.unregister(fd)
@@ -298,7 +298,7 @@
                 # and make the call to poll() from the thread return
                 os.write(w, b'spam')
                 time.sleep(0.3)
-                for i in range(5): print(''),  # to release GIL untranslated
+                for i in range(100): print(''),  # to release GIL untranslated
         finally:
             os.close(r)
             os.close(w)


More information about the pypy-commit mailing list