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

paulk-asert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new a9882132bf minor refactor: try to make JMX tests more resilient on CI
a9882132bf is described below

commit a9882132bf861330c7502730b923f115bc522fdb
Author: Paul King <[email protected]>
AuthorDate: Tue May 12 06:20:25 2026 +1000

    minor refactor: try to make JMX tests more resilient on CI
---
 .../groovy/jmx/builder/JmxListenerFactoryTest.groovy     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git 
a/subprojects/groovy-jmx/src/test/groovy/groovy/jmx/builder/JmxListenerFactoryTest.groovy
 
b/subprojects/groovy-jmx/src/test/groovy/groovy/jmx/builder/JmxListenerFactoryTest.groovy
index 1fc06d3c2a..5e6e562bd3 100644
--- 
a/subprojects/groovy-jmx/src/test/groovy/groovy/jmx/builder/JmxListenerFactoryTest.groovy
+++ 
b/subprojects/groovy-jmx/src/test/groovy/groovy/jmx/builder/JmxListenerFactoryTest.groovy
@@ -22,10 +22,26 @@ import org.junit.jupiter.api.BeforeEach
 import org.junit.jupiter.api.Test
 
 import javax.management.ObjectName
+import java.util.logging.Level
+import java.util.logging.Logger
 
 import static groovy.test.GroovyAssert.shouldFail
 
 class JmxListenerFactoryTest {
+    static {
+        // Prime java.util.Timer's first-use init to absorb a JDK cgroup-v2 
NPE that
+        // sporadically surfaces (CgroupV2Subsystem.getInstance) on 
containerized CI
+        // when the JMX timer test spins up its housekeeper thread. The trip is
+        // environmental and one-shot — after the JVM stashes whatever cgroup 
state
+        // it managed to resolve, later calls succeed.
+        try {
+            new java.util.Timer(true).cancel()
+        } catch (Throwable t) {
+            Logger.getLogger(JmxListenerFactoryTest.name).log(Level.FINE,
+                'Primed java.util.Timer init absorbed exception (likely JDK 
cgroup-v2)', t)
+        }
+    }
+
     def builder
 
     @BeforeEach

Reply via email to