You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ja...@apache.org on 2026/02/17 03:24:52 UTC

(grails-core) branch fix/flaky-scaffolding-geb-tests created (now c59fe669f4)

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

jamesfredley pushed a change to branch fix/flaky-scaffolding-geb-tests
in repository https://gitbox.apache.org/repos/asf/grails-core.git


      at c59fe669f4 test: stabilize flaky scaffolding Geb tests for slow CI environments

This branch includes the following new commits:

     new c59fe669f4 test: stabilize flaky scaffolding Geb tests for slow CI environments

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(grails-core) 01/01: test: stabilize flaky scaffolding Geb tests for slow CI environments

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch fix/flaky-scaffolding-geb-tests
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit c59fe669f47ebfd74ae560e59da0e341de4fc988
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Mon Feb 16 22:24:39 2026 -0500

    test: stabilize flaky scaffolding Geb tests for slow CI environments
    
    Add waitFor assertions to UserControllerSpec and UserCommunityControllerSpec
    to prevent intermittent failures on slower CI runners (observed on JDK 25).
    
    Changes:
    - Add waitFor after login click to verify auth completes before proceeding
    - Wrap title assertions with waitFor for async page load handling
    - Add waitFor for logout button visibility before clicking
    - Remove redundant go '/' before to LoginPage navigation
    
    These specs were the only Geb tests missing waitFor usage, which was
    added to all other functional test specs in e8adf0143f.
---
 .../groovy/com/example/UserCommunityControllerSpec.groovy            | 5 +++--
 .../src/integrationTest/groovy/com/example/UserControllerSpec.groovy | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserCommunityControllerSpec.groovy b/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserCommunityControllerSpec.groovy
index 0b058a9de4..2bfb0f5e78 100644
--- a/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserCommunityControllerSpec.groovy
+++ b/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserCommunityControllerSpec.groovy
@@ -28,16 +28,17 @@ import grails.testing.mixin.integration.Integration
 class UserCommunityControllerSpec extends ContainerGebSpec {
 
     void setup() {
-        go '/'
         to LoginPage
         username = 'test@grails.org'
         password = 'letmein'
         loginButton.click()
+        waitFor { title != 'Please sign in' }
     }
 
     void cleanup() {
         try {
             go 'logout'
+            waitFor { $('input', value: 'Log Out').displayed }
             $('input', value: 'Log Out').click()
         }
         catch (ignored) {
@@ -50,7 +51,7 @@ class UserCommunityControllerSpec extends ContainerGebSpec {
         go 'community/user/index'
 
         then:
-        title == 'User List'
+        waitFor { title == 'User List' }
 
         and:
         !$('table.scaffold')
diff --git a/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserControllerSpec.groovy b/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserControllerSpec.groovy
index f028f3bd23..01f60468c5 100644
--- a/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserControllerSpec.groovy
+++ b/grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/UserControllerSpec.groovy
@@ -28,16 +28,17 @@ import grails.testing.mixin.integration.Integration
 class UserControllerSpec extends ContainerGebSpec {
 
     void setup() {
-        go '/'
         to LoginPage
         username = 'test@grails.org'
         password = 'letmein'
         loginButton.click()
+        waitFor { title != 'Please sign in' }
     }
 
     void cleanup() {
         try {
             go 'logout'
+            waitFor { $('input', value: 'Log Out').displayed }
             $('input', value: 'Log Out').click()
         }
         catch (ignored) {
@@ -50,7 +51,7 @@ class UserControllerSpec extends ContainerGebSpec {
         go 'user/index'
 
         then:
-        title == 'User List'
+        waitFor { title == 'User List' }
 
         and:
         $('table.scaffold')