Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Support for streamlined race condition testing #31

Description

@awestendorf

Spies and side-effects are useful for testing race conditions. The pattern is something like:

def _side_effect(state):
  if state['called']:
    return
  state['called'] = True
  response = race_condition_maker()

self.spy(race_condition_entry_point).side_effect(_side_effect, {'called':False})
race_condition_maker()

This is very useful, but the tracking of called feels like a hack. Try to find a means to streamline the process, perhaps as self.spy(...).race_condition(race_condition_maker, *args, **kwargs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions