Skip to content

Commit

Permalink
Merge pull request #1890 from lprimak/fix-flaky-test
Browse files Browse the repository at this point in the history
bugfix(test): locking flaky failing Guice test
  • Loading branch information
lprimak authored Nov 28, 2024
2 parents 6644d70 + 0538637 commit 669469c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
<surefire.argLine></surefire.argLine>
<!--suppress CheckTagEmptyBody -->
<failsafe.argLine></failsafe.argLine>
<junit5.parallel.tests.enabled>true</junit5.parallel.tests.enabled>
<junit5.parallel.tests.mode>concurrent</junit5.parallel.tests.mode>
<nexus.deploy.skip>false</nexus.deploy.skip>
<nexus-staging-profile>nexus-staging</nexus-staging-profile>
<jacocoAgent/>
Expand Down Expand Up @@ -281,8 +283,8 @@
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<properties>
<configurationParameters>
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}
</configurationParameters>
</properties>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
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;
import org.apache.shiro.session.mgt.DefaultSessionManager;
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;

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -76,6 +77,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;


@Isolated("System property usage")
public class ShiroWebModuleTest {


Expand Down
1 change: 1 addition & 0 deletions support/spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<packaging>bundle</packaging>
<properties>
<module.name>spring</module.name>
<junit5.parallel.tests.enabled>false</junit5.parallel.tests.enabled>
</properties>

<dependencies>
Expand Down

0 comments on commit 669469c

Please sign in to comment.