Skip to content

Commit

Permalink
Augment license check timeout in licensing example (#1931)
Browse files Browse the repository at this point in the history
* Augment timeout to 5s in 13-manage_licensing.py due to timeouts on GitHub

* Clean examples.yml

* Flush prints when running examples
  • Loading branch information
PProfizi authored Nov 25, 2024
1 parent 3d25208 commit d778cdd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .ci/run_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
print(file)
minimum_version_str = get_example_required_minimum_dpf_version(file)
if float(server_version) - float(minimum_version_str) < -0.05:
print(f"Example skipped as it requires DPF {minimum_version_str}.")
print(f"Example skipped as it requires DPF {minimum_version_str}.", flush=True)
continue
try:
out = subprocess.check_output([sys.executable, file])
except subprocess.CalledProcessError as e:
sys.stderr.write(str(e.args))
if e.returncode != 3221225477:
print(out)
print(out, flush=True)
raise e
print("PASS")
print("PASS", flush=True)
1 change: 0 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ jobs:
shell: bash
working-directory: .ci
run: |
echo on
python run_examples.py
- name: "Kill all servers"
Expand Down
2 changes: 1 addition & 1 deletion examples/04-advanced/13-manage_licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
# license increment is used, and for what maximum duration.

# Use the LicenseContextManager to block a specific increment for a limited duration
with dpf.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=1.0) as lic:
with dpf.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=5.0) as lic:
# Instantiate the licensed operator
out = op_premium.eval()
print(out)

0 comments on commit d778cdd

Please sign in to comment.