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

Issue with Spock Parallel execution after upgrade to Selenium 4 #1822

Open
SagarK15 opened this issue Nov 6, 2023 · 5 comments
Open

Issue with Spock Parallel execution after upgrade to Selenium 4 #1822

SagarK15 opened this issue Nov 6, 2023 · 5 comments

Comments

@SagarK15
Copy link

SagarK15 commented Nov 6, 2023

Describe the bug

After upgrade to Selenium 4.13.0 we are facing issue with Geb + spock parallel execution.
We are using Selenium grid deployed through docker for parallel execution.

Geb and Spock Dependencies used:

	spock-junit4 = 2.3-groovy-3.0
	spock-core = 2.3-groovy-3.0
	geb-spock = 6.0

Below is our SpockConfig.groovy file:

runner {

parallel {
    enabled true
    defaultSpecificationExecutionMode ExecutionMode.CONCURRENT
    defaultExecutionMode ExecutionMode.SAME_THREAD
    fixed(5)
}

}

Here if we keep thread count as 5 , ideally spock should send only 5 spec at a time for execution as the defaultSpecificationExecutionMode is concurrent and defaultExecutionMode is SAME_THREAD.But it sends all the spec present in the module and keeps on increasing the Selenium Grid Queue size.

Selenium-Grid-Queue

To Reproduce

Start Selenium Distributed grid 4.13.0 through docker compose with 5 chrome nodes.

Execute Geb test cases with Thread count as 2

Expected behavior

It should run 2 spec at a time as the thread count is fixed as 2.

Actual behavior

Its running all the specs at once and increasing the Selenium grid queue size

Java version

1.8.0_241

Buildtool version

Gradle 5.6

What operating system are you using

Windows

Dependencies

dependencies-report.txt

Additional context

No response

@SagarK15 SagarK15 added the bug label Nov 6, 2023
@kriegaex
Copy link
Contributor

kriegaex commented Nov 6, 2023

After upgrade to Selenium 4.13.0 we are facing issue

Does that mean, before the upgrade it used to work as expected? If so, please also specify the previous version which did what you expect.

@Vampire
Copy link
Member

Vampire commented Nov 6, 2023

What you configure to 5 or 2 is not the "thread count", but the "parallelism".
If a SUT or test for example uses a ForkJoinPool or CompletableFuture with join or similar, that could lead to the behavior you describe.
This is an underlying problem of JUnit Platform tracked at junit-team/junit5#3108.
If my suspicion is correct, I also described a work-around for Spock tests at junit-team/junit5#3108 (comment) that works properly for me so far.

@SagarK15
Copy link
Author

SagarK15 commented Nov 6, 2023

After upgrade to Selenium 4.13.0 we are facing issue

Does that mean, before the upgrade it used to work as expected? If so, please also specify the previous version which did what you expect.

Hello @kriegaex

Yes it used to work as expected with Selenium 3.
Geb : 5.1
Spock : 2.3-groovy-3.0
Selenium : 3.141.59

@leonard84 leonard84 changed the title Title : Issue with Spock Parallel execution after upgrade to Selenium 4 Issue with Spock Parallel execution after upgrade to Selenium 4 Dec 2, 2023
@SagarK15
Copy link
Author

After upgrade to Selenium 4.13.0 we are facing issue

Does that mean, before the upgrade it used to work as expected? If so, please also specify the previous version which did what you expect.

Hey @kriegaex , do we have any update on the problem statement

@Vampire
Copy link
Member

Vampire commented Dec 28, 2023

Did you try the work-around I suggested? If it works, it is that underlying problem in JUnit platform that should be fixed there I also linked to.

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

4 participants