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

jdaugherty pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git


The following commit(s) were added to refs/heads/8.0.x by this push:
     new d090dedf08 Fix flaky tests
d090dedf08 is described below

commit d090dedf08497139095b2f14feaa989572c22a58
Author: James Daugherty <[email protected]>
AuthorDate: Sat Jul 11 13:45:06 2026 -0400

    Fix flaky tests
---
 .../src/integration-test/groovy/functionaltests/ForwardingSpec.groovy  | 3 ++-
 .../src/integration-test/groovy/functionaltests/ForwardingSpec.groovy  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
 
b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
index a0e02a2ac3..e6f7541b9f 100644
--- 
a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
+++ 
b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
@@ -102,6 +102,7 @@ class ForwardingSpec extends ContainerGebSpec {
         go('/forwarding/forwardWithRender')
 
         then: 'The view is rendered correctly'
-        $('p', id: 'message').text() == 'Hello from a forwarded view'
+        // waitFor guards against asserting on the outgoing document before 
the new page has loaded
+        waitFor { $('p', id: 'message').text() == 'Hello from a forwarded 
view' }
     }
 }
diff --git 
a/grails-test-examples/hibernate7/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
 
b/grails-test-examples/hibernate7/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
index a0e02a2ac3..e6f7541b9f 100644
--- 
a/grails-test-examples/hibernate7/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
+++ 
b/grails-test-examples/hibernate7/app1/src/integration-test/groovy/functionaltests/ForwardingSpec.groovy
@@ -102,6 +102,7 @@ class ForwardingSpec extends ContainerGebSpec {
         go('/forwarding/forwardWithRender')
 
         then: 'The view is rendered correctly'
-        $('p', id: 'message').text() == 'Hello from a forwarded view'
+        // waitFor guards against asserting on the outgoing document before 
the new page has loaded
+        waitFor { $('p', id: 'message').text() == 'Hello from a forwarded 
view' }
     }
 }

Reply via email to