Skip to content

Commit 3010530

Browse files
chore(test): prevent 'job_with_artifact' fixture running forever
Previously the 'job_with_artifact' fixture could run forever. Now give it up to 60 seconds to complete before failing.
1 parent 553f5b0 commit 3010530

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/functional/cli/test_cli_artifacts.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@
2424

2525
@pytest.fixture(scope="module")
2626
def job_with_artifacts(gitlab_runner, project):
27+
start_time = time.time()
28+
2729
project.files.create(data)
2830

2931
jobs = None
3032
while not jobs:
3133
time.sleep(0.5)
3234
jobs = project.jobs.list(scope="success")
35+
if time.time() - start_time > 60:
36+
for job in jobs:
37+
job.pprint()
38+
assert None, "Fixture 'job_with_artifact' failed"
3339

3440
return project.jobs.get(jobs[0].id)
3541

0 commit comments

Comments
 (0)