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

Attempt to fix the flaky TestTriggererJob test #34075

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/jobs/test_triggerer_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def __init__(self, password, **kwargs):
finally:
# We always have to stop the runner
triggerer_job_runner.trigger_runner.stop = True
triggerer_job_runner.trigger_runner.join(30)

# Since we have now an in-memory process of forwarding the logs to stdout,
# give it more time for the trigger event to write the log.
time.sleep(0.5)
Expand Down Expand Up @@ -257,6 +259,7 @@ def test_trigger_lifecycle(session):
finally:
# We always have to stop the runner
job_runner.trigger_runner.stop = True
job_runner.trigger_runner.join(30)


class TestTriggerRunner:
Expand Down Expand Up @@ -408,7 +411,7 @@ def handle_events(self):
pytest.fail("did not observe 2 loops in the runner thread")
finally:
job_runner.trigger_runner.stop = True
job_runner.trigger_runner.join()
job_runner.trigger_runner.join(30)
thread.join()
instances = path.read_text().splitlines()
assert len(instances) == 1
Expand Down Expand Up @@ -514,7 +517,7 @@ async def create_triggers(self):
finally:
job_runner.trigger_runner.stop = True
# with suppress(MockTriggerException):
job_runner.trigger_runner.join()
job_runner.trigger_runner.join(30)
thread.join()


Expand Down Expand Up @@ -545,6 +548,7 @@ def test_trigger_firing(session):
finally:
# We always have to stop the runner
job_runner.trigger_runner.stop = True
job_runner.trigger_runner.join(30)


def test_trigger_failing(session):
Expand Down Expand Up @@ -578,6 +582,7 @@ def test_trigger_failing(session):
finally:
# We always have to stop the runner
job_runner.trigger_runner.stop = True
job_runner.trigger_runner.join(30)


def test_trigger_cleanup(session):
Expand Down