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

-Dkarate.options flag disables the parallel execution in 1.4.1 #2444

Open
bondar-artem opened this issue Nov 10, 2023 · 5 comments
Open

-Dkarate.options flag disables the parallel execution in 1.4.1 #2444

bondar-artem opened this issue Nov 10, 2023 · 5 comments
Assignees
Milestone

Comments

@bondar-artem
Copy link

Description:
When using a flag in the command line to run tests with a -Dkarate.options, it disables the parallel execution of the tests.

Project to reproduce: https://github.com/bondar-artem/karate-parallel-issue

Steps:

  1. Open project, run mvn clean test. 5 tests executed in parallel
  2. Run command mvn clean test "-Dkarate.options=classpath:examples/TestParallel.feature". Tests executed in a single thread
  3. Update karate to version 1.4.0, and execute command from the step 2. Tests executed in parallel.
@ptrthomas ptrthomas added this to the 1.5.0 milestone Nov 10, 2023
@ptrthomas
Copy link
Member

@bondar-artem thanks for the repro ! it would be good to confirm if -Dkarate.options=-T 5 classpath:examples/TestParallel.feature is a workaround.

I hope there are no concerns if the fix is for1.5.0 - which means Java 17 is a must.

@bondar-artem
Copy link
Author

Thank you, Peter! Yeah looks like this workaround works!
No concerns for me about Java 17 :)

@dvargas46
Copy link
Contributor

My team and I experienced this issue too. We use karate.options quite often (w/o the threads arg) to run certain tags on demand, it's really handy. Since we set the thread count on the builder config, we expect it to use that value when no override is specified on karate.options, but we see it going back to 1 instead.

I think one possible solution could be to use a boxed integer for the thread count on Main without a default value. That way we could do a simple null check when it's parsed in the Runner to see if it was a supplied option or not, similar to the other options. I can test it out sometime and create a PR if it works out.

@ptrthomas
Copy link
Member

@dvargas46 yes please do submit a PR this - thanks for the work on the other one I will merge when I get a chance

dvargas46 added a commit to dvargas46/karate that referenced this issue Jan 19, 2024
ptrthomas added a commit that referenced this issue Jan 20, 2024
fix thread count issue when using karate.options #2444
@ptrthomas
Copy link
Member

karate 1.5.0.RC3 including this fix is now available

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

3 participants