jamesfredley commented on code in PR #15335:
URL: https://github.com/apache/grails-core/pull/15335#discussion_r2725863978


##########
grails-validation/src/test/groovy/grails/validation/ValidateableTraitSpec.groovy:
##########
@@ -36,6 +36,16 @@ import java.lang.reflect.Method
  */
 class ValidateableTraitSpec extends Specification {
 
+    /**
+     * Clear the static constraints cache for classes that use shared 
constraints.
+     * This is necessary because the Validateable trait caches constraints in 
a static field,
+     * and in parallel test execution, the constraints may be evaluated before 
configuration
+     * has registered the shared constraints.
+     */
+    void setup() {
+        SharedConstraintsValidateable.clearConstraintsMap()

Review Comment:
   Added



##########
grails-validation/src/test/groovy/grails/validation/ValidateableTraitAdHocSpec.groovy:
##########
@@ -27,6 +27,16 @@ import spock.lang.Specification
 
 class ValidateableTraitAdHocSpec extends Specification {
 
+    /**
+     * Clear the static constraints cache for classes that use shared 
constraints.
+     * This is necessary because the Validateable trait caches constraints in 
a static field,
+     * and in parallel test execution, the constraints may be evaluated before 
configuration
+     * has registered the shared constraints.
+     */
+    void setup() {
+        PersonAdHocSharedConstraintsValidateable.clearConstraintsMap()

Review Comment:
   Added



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to