Skip to content

Should we actually run fixtures concurrently? #57

Open
@njsmith

Description

@njsmith

Upsides:

Counterarguments:

  • Might increase the chance of flaky tests, race conditions, etc.
    • In particular, race conditions involving ContextVars (see Rework fixtures #50 (comment)) – currently fixtures all share a contextvars.Context, so if multiple fixtures are mutating the same ContextVar, the results will be random. (Of course, doing this is inherently nonsensical. But nonsensical-and-consistent is still better than nonsensical-and-random.)
  • Might make failing tests harder to debug
  • Is there really that much concurrency to extract from fixture setup? How many people use multiple independent fixtures that need to block for significant amounts of time?
  • Running them sequentially isn't actually that hard, if we let pytest pick the order for us (see Rework fixtures #50 (comment))

Leaving this issue open for now for discussion, and to collect any positive/negative experiences people want to report.

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