On 30.05.23 07:24, Debraj Manna wrote:
Thanks, Nils for replying.

In JUnit5 it looks like running tests in parallel is still an experimental
feature.

Technically you are correct... but it's already a long time there I
doubt that it will be removed.....
> So I was checking if it is possible to do the same via Surefire.

I recommend to use JUnit Jupiter...

Btw: JUnit Jupiter is available in version 5.9.3 and also 5.10.0-M1 is
available as milestone one...

Furthermore the users guide of 5.10.0-M1
(https://junit.org/junit5/docs/5.10.0-M1/user-guide/index.html#writing-tests-parallel-execution)
shows that the WARNING about experimental feature has been removed...

 https://junit.org/junit5/docs/current/user-guide/

https://junit.org/junit5/



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?




Mit freundlichem Gruß
Karl Heinz Marbaise
--
SoftwareEntwicklung Beratung Schulung      Tel.: +49 (0) 2405 / 415 893
Inhaber Dipl.Ing.(FH) Karl Heinz Marbaise  USt.IdNr: DE191347579
Hauptstrasse 177
52146 Würselen                             https://www.soebes.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to