question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All scenarios from same feature file are running in isolation even if only one has the @isolated tag

See original GitHub issue

👓 What did you see?

While executing scenarios in parallel using cucumber-junit-platform-engine and “isolated” as a global exclusive resource, it seems that all scenarios from same feature file are executed in isolation, even though only one of them has the @isolated tag

✅ What did you expect to see?

Only the scenario with the @isolated tag should run isolated. The other scenarios from same feature should run in parallel.

📦 Which tool/library version are you using?

Cucumber Java 7.4.1

🔬 How could we reproduce it?

Steps to reproduce the behavior:

1.) Set the following configuration inside junit-platform.properties

cucumber.execution.parallel.config.strategy = fixed
cucumber.execution.parallel.config.fixed.parallelism=8
cucumber.execution.exclusive-resources.isolated.read-write=org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY
cucumber.junit-platform.naming-strategy=long

2.) Create two feature files having each 3 scenarios 3.) Tag the second scenario from first feature file with @isolated 3.) Run all tests

Actual: Scenarios running in the same time: Feature 2 - Scenario 1 Feature 2 - Scenario 2 Feature 2 - Scenario 3

Scenarios running in serial: Feature 1 - Scenario 1 Feature 1 - Scenario 2 (tagged with @isolated) Feature 1 - Scenario 3

You can see the following timeline report: image

I must admint that I can’t say for sure if this a cucumber-junit-platform-engine issue, a Junit 5 issue or something in between.

You can reproduce the problem by running the following showcase:

git@github.com:fslev/cucumber-showcase.git

mvn clean test

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mpkorstanjecommented, Jul 24, 2022

Nah. I believe this is something that should be fixed in JUnit 5. Currently the JUnit Platform implements an assumption about one test engine (JUnit Jupiter) that does not apply to another (Cucumber).

0reactions
mpkorstanjecommented, Sep 15, 2022

Not much we can do here on the Cucumber side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Want to execute Background only once in Cucumber feature ...
Create setup scenario and It will always execute in first place. After first scenario it will execute all scenario and You don't need...
Read more >
How to fix dependancy chains in your scenarios. - SpecFlow
We have a long feature file. The scenarios build on each other, so the result of one scenario is effectively the starting point...
Read more >
Cucumber Tags - Tools QA
Running Cucumber Tests with Cucumber Tags. How to skip tests in group execution. How to ignore or skipping Cucumber Tests Logically ANDing ...
Read more >
State - Cucumber Documentation
Leaking state makes your scenarios brittle, and difficult to run in isolation. To prevent leaking state between scenarios: Avoid using global or static ......
Read more >
Are Gherkin Scenarios with Multiple When-Then Pairs Okay?
Ideally, each behavior would already have its own individual scenario, but then a new scenario would explicitly combine the behaviors together ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found