aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Plangger <planrichi@gmail.com>2016-04-18 10:07:59 +0200
committerRichard Plangger <planrichi@gmail.com>2016-04-18 10:07:59 +0200
commit7dcb0069765f3c23840f7d444d7c8d39c098c2d9 (patch)
treea18f9fe6c2a2c67dbfa3802a9398bcc9847ff374
parentimport cffi/5d45c8d8df09 and add missing file (diff)
downloadpypy-7dcb0069765f3c23840f7d444d7c8d39c098c2d9.tar.gz
pypy-7dcb0069765f3c23840f7d444d7c8d39c098c2d9.tar.bz2
pypy-7dcb0069765f3c23840f7d444d7c8d39c098c2d9.zip
rewritten test, sleeping up to ~25 second to wait for the initial thread to start
-rw-r--r--rpython/rlib/test/test_rthread.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/rpython/rlib/test/test_rthread.py b/rpython/rlib/test/test_rthread.py
index 2a5b0c3084..b51001f6ab 100644
--- a/rpython/rlib/test/test_rthread.py
+++ b/rpython/rlib/test/test_rthread.py
@@ -246,8 +246,6 @@ class TestUsingBoehm(AbstractThreadTests):
class TestUsingFramework(AbstractThreadTests):
gcpolicy = 'minimark'
- @py.test.mark.xfail(platform.machine() == 's390x',
- reason='may fail this test under heavy load')
def test_tlref_keepalive(self, no__thread=True):
import weakref
from rpython.config.translationoption import SUPPORT__THREAD
@@ -289,7 +287,12 @@ class TestUsingFramework(AbstractThreadTests):
wr_from_thread.seen = False
start_new_thread(thread_entry_point, ())
wr1 = f()
- time.sleep(0.5)
+ count = 0
+ while True:
+ time.sleep(0.5)
+ if wr_from_thread.seen or count >= 50:
+ break
+ count += 1
assert wr_from_thread.seen is True
wr2 = wr_from_thread.wr
import gc; gc.collect() # wr2() should be collected here
@@ -302,7 +305,5 @@ class TestUsingFramework(AbstractThreadTests):
res = fn()
assert res == 42
- @py.test.mark.xfail(platform.machine() == 's390x',
- reason='may fail this test under heavy load')
def test_tlref_keepalive__thread(self):
self.test_tlref_keepalive(no__thread=False)