groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] 14/23: Adjust sleep period in `CodeGenerationASTTransformsTest`
Date Fri, 11 Oct 2019 13:54:27 GMT
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 801ddbb56ea990eb5d269769bcbe4ee2a7daef0c
Author: Daniel.Sun <realbluesun@hotmail.com>
AuthorDate: Fri Oct 11 14:23:15 2019 +0800

    Adjust sleep period in `CodeGenerationASTTransformsTest`
    
    (cherry picked from commit 627869fd1e80dff34e66d228cf61675a055d83ce)
---
 src/spec/test/CodeGenerationASTTransformsTest.groovy | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/spec/test/CodeGenerationASTTransformsTest.groovy b/src/spec/test/CodeGenerationASTTransformsTest.groovy
index d253bb2..b19775d 100644
--- a/src/spec/test/CodeGenerationASTTransformsTest.groovy
+++ b/src/spec/test/CodeGenerationASTTransformsTest.groovy
@@ -403,8 +403,10 @@ import groovy.transform.Immutable
 
 @Immutable
 class SlowHashCode {
+    static final SLEEP_PERIOD = 500
+
     int hashCode() {
-        sleep 100
+        sleep SLEEP_PERIOD
         127
     }
 }
@@ -420,7 +422,7 @@ p.hashCode()
 
 def start = System.currentTimeMillis()
 p.hashCode()
-assert System.currentTimeMillis() - start < 100
+assert System.currentTimeMillis() - start < SlowHashCode.SLEEP_PERIOD
 // end::equalshashcode_example_cache[]
 '''
     }


Mime
View raw message