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

Add 'ignore-trailing-jobs' as optional flag #2759

Merged
merged 4 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ async def _main() -> None:
start_time = datetime.now()
print("Executing notebooks:")
results = await asyncio.gather(*(execute_notebook(job) for job in jobs))
print("Checking for trailing jobs...")
results.append(cancel_trailing_jobs(start_time))

if not args.ignore_trailing_jobs:
print("Checking for trailing jobs...")
results.append(cancel_trailing_jobs(start_time))

if not all(results):
sys.exit(1)

Expand Down
8 changes: 8 additions & 0 deletions scripts/nb-tester/qiskit_docs_notebook_tester/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,12 @@ def get_parser() -> argparse.ArgumentParser:
"This affects which notebooks are run and how they're patched."
),
)
parser.add_argument(
"--ignore-trailing-jobs",
action="store_true",
help=(
"Do not cancel trailing jobs with QiskitRuntimeService. This is "
"useful to set if your patch does not use QiskitRuntimeService"
),
)
return parser