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

Support for streamlined race condition testing #31

Open
awestendorf opened this issue May 23, 2016 · 0 comments
Open

Support for streamlined race condition testing #31

awestendorf opened this issue May 23, 2016 · 0 comments

Comments

@awestendorf
Copy link
Member

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).

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