3

Problem

Since yesterday, I am unable to launch a proper debug of my tests. Debugger happily jumps over my breakpoints. I validated that the code was actually executed by adding some logs.

What I've tried so far

  • Synchronize project
  • Clean, reinstall and rebuild the project
  • Purge Maven dependencies
  • Upgrade IntelliJ IDEA to the last version
  • Read IntelliJ docs about configuring debugger options
  • Browse questions that had been asked before, with no success (for instance here, here and here).

More info about the project

The executed Java code is in one of the folders declared as test sources (one is "java" for Selenium tests, other is "scala" for Gatling tests).

My Maven command line is pretty straightforward: package clean -Dtest=MyTestClass integration-test.

EDIT: My POM configuration does mention reuseForks and forkCount. I've also tried playing with deprecated forkMode, but with no success.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.20.1</version>
    <configuration>
        <skip>${skip.selenium.tests}</skip>
        <parallel>none</parallel>
        <threadCount>1</threadCount>
        <reuseForks>false</reuseForks>
        <forkCount>0</forkCount>
        <disableXmlReport>false</disableXmlReport>
    </configuration>
    <executions>
        <execution>
            <id>runSeleniumTests</id>
            <phase>integration-test</phase>
            <goals>
                <goal>integration-test</goal>
            </goals>
        </execution>
    </executions>
</plugin>

What is funny, though: debugger actually stops at breakpoints when I right-click on the project root or on test sources root ("java" folder) and click on "Debug 'All tests'".

Any help... will help.

Matheus Lacerda
  • 5,983
  • 11
  • 29
  • 45
Zoette
  • 1,241
  • 2
  • 18
  • 49

1 Answers1

2

If you are using surefire plugin it runs your test in another process hence you are not able to debug.

Use forkMode=never in your maven configuration

Code_Eat_Sleep
  • 303
  • 2
  • 6