Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven forkCount and reuseForks apparently not respected #1654

Open
marlon-sousa opened this issue Jan 23, 2024 · 1 comment
Open

Maven forkCount and reuseForks apparently not respected #1654

marlon-sousa opened this issue Jan 23, 2024 · 1 comment

Comments

@marlon-sousa
Copy link

Hello,

I am using systemstubs library.

As its author said, because of the way the library works, tests using it must be running in a forked vm, one per test.

I have been able to make this work in maven.

I have a multi module pom.xml. In my specific module pom.xml I configured sure-fire as follows:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>

                <configuration>
                    <forkCount>2.5C</forkCount>
                    <reuseForks>false</reuseForks>
                </configuration>

            </plugin>

This makes tests run by maven in cli run correctly.

However, when I run tests in vs code, they behave exactly as like they did when maven had not been configured with 1 fork, not reusing forks.

it seems as if not only is vs code not forking vms, it is running even methods in paralel, because tests in the same class are conflicting, while they should run sequentially in one thread, one after the other, in a class exclusive jvm process as maven is doing.

This makes me believe that either

  • vscode has its own runner and does not delegate to maven the test running OR
  • Some how delegation is ignoring the specific configuration in the module's pom.xml.

I have been searching a way to let vscode test runner know tthat either it should fork jvm process and run one test in each vm or it should delegate and follow what is specified in pom.xml.

Another desired and may be faster solution is to find (something I haven't found either) a way of asking vscode to just ignore these tests when running tests, so that we stop having failures on the test result.

Can you please provide me with information on how to proceed?

@jdneo
Copy link
Member

jdneo commented Jan 24, 2024

Looks like we need to support fork mode to support your case. Like what IDEA does:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants