Thanks, Nils for replying.

In JUnit5 it looks like running tests in parallel is still an experimental
feature. So I was checking if it is possible to do the same via Surefire.

On Mon, May 29, 2023 at 9:05 PM Nils Breunese <n...@breun.nl> wrote:

> I don’t have answers for your Surefire questions, but I wanted to mention
> that you can also tell JUnit 5.9.2 to execute tests in parallel:
> https://junit.org/junit5/docs/5.9.2/user-guide/index.html
>
> Nils.
>
> > Op 29 mei 2023 om 16:13 heeft Debraj Manna <subharaj.ma...@gmail.com>
> het volgende geschreven:
> >
> > I updated by command like below
> >
> > mvn test -Dorg.slf4j.simpleLogger.showThreadName=true
> >
> > But I am observing that all my test classes are being executed in
> > ThreadStreamConsumer
> >
> > [ThreadedStreamConsumer] [INFO] Running
> > com.spotnana.servicetests.profile.ProfileCreatePersonalUserTest
> > ...
> > [ThreadedStreamConsumer] [INFO] Running
> > com.spotnana.servicetests.profile.PlanServiceTest
> >
> > So can someone let me know if this is the correct way of logging the
> > parallel execution identifier in maven output logs? If yes then what am I
> > doing wrong which is causing all test classes to execute in a single
> thread?
> >
> > Junit Version - 5.9.2
> >
> >
> >> On Mon, May 29, 2023 at 6:53 PM Debraj Manna <subharaj.ma...@gmail.com>
> >> wrote:
> >>
> >> I want to execute test classes concurrently in the same JVM. So my
> >> surefire-plugin config looks like below
> >>
> >> <plugin>
> >>  <groupId>org.apache.maven.plugins</groupId>
> >>  <artifactId>maven-surefire-plugin</artifactId>
> >>  <version>3.0.0-M7</version>
> >>  <configuration>
> >>    <systemPropertyVariables>
> >>      <ut.forkNumber>$${surefire.forkNumber}</ut.forkNumber>
> >>    </systemPropertyVariables>
> >>    <!--These values are chosen experimentally-->
> >>    <argLine>
> >>      -Xms512m -Xmx${surefire.max.heap}
> >>      -XX:MaxDirectMemorySize=${surefire.max.direct.memory}
> >>      -XX:MaxMetaspaceSize=${surefire.metaspace.size}
> >>      -XX:+HeapDumpOnOutOfMemoryError @{argLine}
> >>    </argLine>
> >>    <parallel>suitesAndClasses</parallel>
> >>    <perCoreThreadCount>false</perCoreThreadCount>
> >>    <threadCount>${surefire.threadCount}</threadCount>
> >>    <forkCount>1</forkCount>
> >>    <reuseForks>true</reuseForks>
> >>  </configuration>
> >> </plugin>
> >>
> >> Can someone let me know if there is a way for me to know which test
> >> classes are being executed in which surefire thread?
> >>
>

Reply via email to