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

Geb's reporting is not thread safe #201

Open
Poundex opened this issue Oct 26, 2024 · 0 comments
Open

Geb's reporting is not thread safe #201

Poundex opened this issue Oct 26, 2024 · 0 comments

Comments

@Poundex
Copy link
Contributor

Poundex commented Oct 26, 2024

Geb's reporting is not thread safe.

This assumption is documented at the top of GebTestManager.groovy:

/**
 * This implementation assumes that a thread is reserved for one test execution at least from
 * {@code beforeTest} until {@code afterTest}, and that {@code beforeTestClass} and {@code afterTestClass}
 * are called on the same thread, even if the thread executed some test inbetween.
 * There should also only be one instance for all tests of a class even if run in parallel.
 */

however that assumption appears to be incorrect for the default execution mode of parallel specs + parallel features (see Spock Documentation).

The end result is probably going to be that reports end up in the wrong directory (through a chain of ThreadLocals eventually ending up at Browser's reportGroup property). However, in the event that feature methods in different specs running in parallel happen to have the same name (which is the case for Geb's failing ParallelExecutionSpec) then not only do files get written into the wrong directory, but because the filenames collide then they end up overwriting each other.

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

No branches or pull requests

1 participant