You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/02/01 00:02:47 UTC

[groovy] 01/08: wait a little longer - avoid occasional fail when run on a machine under heavy load

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit b16cf40a4fac57b035ea0a6f9faf87e6104212d0
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Jan 30 12:30:28 2020 +1000

    wait a little longer - avoid occasional fail when run on a machine under heavy load
    
    (cherry picked from commit ddf2d602ec5bcc3e961525ba16288b5ceca55efd)
---
 src/test/groovy/ThreadMethodsTest.groovy | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/test/groovy/ThreadMethodsTest.groovy b/src/test/groovy/ThreadMethodsTest.groovy
index 2139612..abcb410 100644
--- a/src/test/groovy/ThreadMethodsTest.groovy
+++ b/src/test/groovy/ThreadMethodsTest.groovy
@@ -27,14 +27,14 @@ class ThreadMethodsTest extends GroovyTestCase {
     final CyclicBarrier barrier = new CyclicBarrier(2)
     void testThreadNaming() {
         def t = Thread.start("MyNamedThread") {
-            barrier.await(3L, TimeUnit.SECONDS) // Signal Thread Start
-            barrier.await(3L, TimeUnit.SECONDS) // Wait for thread stop signal
+            barrier.await(4L, TimeUnit.SECONDS) // Signal Thread Start
+            barrier.await(4L, TimeUnit.SECONDS) // Wait for thread stop signal
         }
 
-        barrier.await(3L, TimeUnit.SECONDS) // Wait for thread start signal
+        barrier.await(4L, TimeUnit.SECONDS) // Wait for thread start signal
         boolean threadFoundByName = Thread.allStackTraces.keySet().any { thread -> thread.name == 'MyNamedThread' }
-        barrier.await(3L, TimeUnit.SECONDS) // Send thread stop signal
-        t.join(100L)
+        barrier.await(4L, TimeUnit.SECONDS) // Send thread stop signal
+        t.join(200L)
         assert threadFoundByName
     }
 }
\ No newline at end of file