Skip to content

Commit

Permalink
Fixup a flaky test setup
Browse files Browse the repository at this point in the history
Ensure that infrastructure is in place before we let the tests poke at it.  The
flakiness is a very rare occurrence -- I've only encountered it once, recently
-- but flaky == no good.
  • Loading branch information
khk-globus committed Nov 4, 2024
1 parent cd3e891 commit ea61f89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compute_sdk/tests/unit/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def __init__(self, *args, **kwargs):

def start(self) -> None:
super().start()

# important for tests to ensure the `.run()` has had a chance to be invoked
# before the tests poke at the internals.
try_assert(lambda: self._connection is not None)
try_assert(lambda: self._channel is not None)

def run(self):
self._connection = mock.MagicMock()
Expand Down

0 comments on commit ea61f89

Please sign in to comment.