Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5e169be

Browse files
chore(test): prevent 'job_with_artifact' fixture running forever
Previously the 'job_with_artifact' fixture could run forever. Now giveit up to 60 seconds to complete before failing.
1 parent553f5b0 commit5e169be

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎tests/functional/cli/test_cli_artifacts.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importlogging
12
importsubprocess
23
importtextwrap
34
importtime
@@ -24,12 +25,22 @@
2425

2526
@pytest.fixture(scope="module")
2627
defjob_with_artifacts(gitlab_runner,project):
28+
start_time=time.time()
29+
2730
project.files.create(data)
2831

2932
jobs=None
3033
whilenotjobs:
3134
time.sleep(0.5)
3235
jobs=project.jobs.list(scope="success")
36+
iftime.time()-start_time<60:
37+
continue
38+
logging.error("job never succeeded")
39+
forjobinproject.jobs.list():
40+
job=project.jobs.get(job.id)
41+
logging.info(f"{job.status} job:{job.pformat()}")
42+
logging.info(f"job log:\n{job.trace()}\n")
43+
pytest.fail("Fixture 'job_with_artifact' failed")
3344

3445
returnproject.jobs.get(jobs[0].id)
3546

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp