From 0538637b3eecb59041b9e1138598a05a3a9b74f5 Mon Sep 17 00:00:00 2001 From: lprimak Date: Wed, 27 Nov 2024 20:51:21 -0700 Subject: [PATCH] bugfix(tests): Lock parallel execution for Guice, disable parallel tests for Spring --- pom.xml | 6 ++++-- .../test/java/org/apache/shiro/guice/ShiroModuleTest.java | 4 +++- .../java/org/apache/shiro/guice/web/ShiroWebModuleTest.java | 2 ++ support/spring/pom.xml | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 62f5ad5306..dde9a9f3d4 100644 --- a/pom.xml +++ b/pom.xml @@ -75,6 +75,8 @@ + true + concurrent false nexus-staging @@ -281,8 +283,8 @@ true - junit.jupiter.execution.parallel.enabled = true - junit.jupiter.execution.parallel.mode.default = concurrent + junit.jupiter.execution.parallel.enabled = ${junit5.parallel.tests.enabled} + junit.jupiter.execution.parallel.mode.default = ${junit5.parallel.tests.mode} diff --git a/support/guice/src/test/java/org/apache/shiro/guice/ShiroModuleTest.java b/support/guice/src/test/java/org/apache/shiro/guice/ShiroModuleTest.java index 2631ff8bec..587be8cee3 100644 --- a/support/guice/src/test/java/org/apache/shiro/guice/ShiroModuleTest.java +++ b/support/guice/src/test/java/org/apache/shiro/guice/ShiroModuleTest.java @@ -31,6 +31,7 @@ import org.apache.shiro.event.EventBus; import org.apache.shiro.event.EventBusAware; import org.apache.shiro.event.Subscribe; +import org.apache.shiro.lang.util.Destroyable; import org.apache.shiro.mgt.DefaultSecurityManager; import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.realm.Realm; @@ -38,7 +39,7 @@ import org.apache.shiro.session.mgt.SessionManager; import org.apache.shiro.subject.Subject; import org.junit.jupiter.api.Test; -import org.apache.shiro.lang.util.Destroyable; +import org.junit.jupiter.api.parallel.Isolated; import java.util.Collection; @@ -51,6 +52,7 @@ import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; +@Isolated("System property usage") public class ShiroModuleTest { @Test diff --git a/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java b/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java index 1c0416896d..c28f62e934 100644 --- a/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java +++ b/support/guice/src/test/java/org/apache/shiro/guice/web/ShiroWebModuleTest.java @@ -47,6 +47,7 @@ import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Isolated; import javax.inject.Named; import javax.servlet.Filter; @@ -76,6 +77,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; +@Isolated("System property usage") public class ShiroWebModuleTest { diff --git a/support/spring/pom.xml b/support/spring/pom.xml index 69efb8e84d..07b3e9f55e 100644 --- a/support/spring/pom.xml +++ b/support/spring/pom.xml @@ -32,6 +32,7 @@ bundle spring + false