Skip to content

Geb's reporting is not thread safe #201

@Poundex

Description

@Poundex

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions