Skip to content

Race condition calling RandomizedTest.isNightly #311

@javanna

Description

@javanna

We are hitting a race condition evaluating RandomizedTest#isNightly. While the RandomizedContext is per thread, the group evaluator is shared and accessed across different ranzomized contexts, hence concurrent calls to GroupEvaluator#isGroupEnabled are not supported.
We get a NullPointerException on the last line despite the test group should be lazily added just before:

return testGroups.get(testGroupAnnotation).enabled;

This is unfortunate and comes from multiple threads calling RandomizedTest#isNightly concurrently. Simply calling the method before forking to multiple threads should fix it on our end, yet there is probably room for a better fix upstream. If the group evaluator is supposed to be shared across threads, perhaps it should be thread-safe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions