You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2026/07/30 17:46:11 UTC
(grails-core) 01/01: test(neo4j): give OptimisticLockingSpec's cross-thread heisenbug more headroom
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch test/neo4j-optimistic-locking-spec-flake
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 184020c5c1e93455fa3cf9e27103b05d3b8fe50b
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Thu Jul 30 12:32:27 2026 -0500
test(neo4j): give OptimisticLockingSpec's cross-thread heisenbug more headroom
CI on PR #15972 (Neo4j GormRegistry migration) hit a reproducible-looking
failure in "Test optimistic locking" on a loaded macos-latest runner.
Investigation traced it to this test's own pre-existing timing sensitivity
(flagged by its own "heisenbug" comment), not a regression from the
GormRegistry wiring: the unmodified test passes locally against the exact
failing commit, and the background thread's write is already synchronized
via join() before the sleep runs. The sleep is headroom for the embedded
Neo4j 3.5.x harness's own write durability, which a noisy CI runner can
push past 2 seconds. Bumped to 5 seconds in both affected examples.
Co-Authored-By: Claude Sonnet 5 <no...@anthropic.com>
---
.../test/groovy/grails/gorm/tests/OptimisticLockingSpec.groovy | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/grails-data-neo4j/grails-datastore-gorm-neo4j/src/test/groovy/grails/gorm/tests/OptimisticLockingSpec.groovy b/grails-data-neo4j/grails-datastore-gorm-neo4j/src/test/groovy/grails/gorm/tests/OptimisticLockingSpec.groovy
index e83f0a24d2..318bc0eb6f 100644
--- a/grails-data-neo4j/grails-datastore-gorm-neo4j/src/test/groovy/grails/gorm/tests/OptimisticLockingSpec.groovy
+++ b/grails-data-neo4j/grails-datastore-gorm-neo4j/src/test/groovy/grails/gorm/tests/OptimisticLockingSpec.groovy
@@ -96,7 +96,11 @@ class OptimisticLockingSpec extends GormDatastoreSpec {
}
}
}.join()
- sleep 2000 // heisenbug
+ // The background thread's save is already synchronized via join() above; this sleep is
+ // headroom for the embedded Neo4j harness's own write durability, not thread completion.
+ // A noisy/loaded CI runner can push that past a couple of seconds - give it more room
+ // rather than risk a spurious failure (heisenbug).
+ sleep 5000
o.name += ' in main session'
def ex
@@ -137,7 +141,8 @@ class OptimisticLockingSpec extends GormDatastoreSpec {
} catch (InterruptedException e) {
// ignore
}
- sleep 2000 // heisenbug
+ // Same headroom rationale as "Test optimistic locking" above.
+ sleep 5000
o.name += ' in main session'
def ex