From 15e68277c109d238bfb9c5bb8ab7db2f89e24c26 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 31 May 2016 11:54:34 +0100 Subject: [PATCH] tests/thread: Make sure that thread tests don't rely on floating point. --- tests/thread/stress_aes.py | 2 +- tests/thread/thread_exit1.py | 2 +- tests/thread/thread_exit2.py | 2 +- tests/thread/thread_lock2.py | 2 +- tests/thread/thread_sleep1.py | 2 +- tests/thread/thread_start1.py | 2 +- tests/thread/thread_start2.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/thread/stress_aes.py b/tests/thread/stress_aes.py index 6ef285595..ecc963c92 100644 --- a/tests/thread/stress_aes.py +++ b/tests/thread/stress_aes.py @@ -252,4 +252,4 @@ if __name__ == '__main__': for i in range(n_thread): _thread.start_new_thread(thread_entry, ()) while count.value < n_thread: - time.sleep(0.1) + time.sleep(1) diff --git a/tests/thread/thread_exit1.py b/tests/thread/thread_exit1.py index aa35995c1..88cdd165c 100644 --- a/tests/thread/thread_exit1.py +++ b/tests/thread/thread_exit1.py @@ -15,5 +15,5 @@ _thread.start_new_thread(thread_entry, ()) _thread.start_new_thread(thread_entry, ()) # wait for threads to finish -time.sleep(0.2) +time.sleep(1) print('done') diff --git a/tests/thread/thread_exit2.py b/tests/thread/thread_exit2.py index 797b52c35..368a11bba 100644 --- a/tests/thread/thread_exit2.py +++ b/tests/thread/thread_exit2.py @@ -15,5 +15,5 @@ _thread.start_new_thread(thread_entry, ()) _thread.start_new_thread(thread_entry, ()) # wait for threads to finish -time.sleep(0.2) +time.sleep(1) print('done') diff --git a/tests/thread/thread_lock2.py b/tests/thread/thread_lock2.py index 25953d9ff..405f10b0b 100644 --- a/tests/thread/thread_lock2.py +++ b/tests/thread/thread_lock2.py @@ -20,5 +20,5 @@ for i in range(4): _thread.start_new_thread(thread_entry, ()) # wait for threads to finish -time.sleep(0.2) +time.sleep(1) print('done') diff --git a/tests/thread/thread_sleep1.py b/tests/thread/thread_sleep1.py index 0fb8de86e..5f7534f6a 100644 --- a/tests/thread/thread_sleep1.py +++ b/tests/thread/thread_sleep1.py @@ -24,5 +24,5 @@ for i in range(n_thread): # wait for threads to finish while n_finished < n_thread: - time.sleep(0.1) + time.sleep(1) print('done', n_thread) diff --git a/tests/thread/thread_start1.py b/tests/thread/thread_start1.py index b799fbe02..d23a74aa2 100644 --- a/tests/thread/thread_start1.py +++ b/tests/thread/thread_start1.py @@ -19,5 +19,5 @@ _thread.start_new_thread(thread_entry, (10,)) _thread.start_new_thread(thread_entry, (20,)) # wait for threads to finish -time.sleep(0.2) +time.sleep(1) print('done') diff --git a/tests/thread/thread_start2.py b/tests/thread/thread_start2.py index 2b444cc0c..4efa808eb 100644 --- a/tests/thread/thread_start2.py +++ b/tests/thread/thread_start2.py @@ -15,5 +15,5 @@ def thread_entry(a0, a1, a2, a3): _thread.start_new_thread(thread_entry, (10, 20), {'a2': 0, 'a3': 1}) # wait for thread to finish -time.sleep(0.2) +time.sleep(1) print('done')