Skip to content

Commit d778cdd

Browse files
authored
Augment license check timeout in licensing example (#1931)
* Augment timeout to 5s in 13-manage_licensing.py due to timeouts on GitHub * Clean examples.yml * Flush prints when running examples
1 parent 3d25208 commit d778cdd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.ci/run_examples.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
print(file)
3434
minimum_version_str = get_example_required_minimum_dpf_version(file)
3535
if float(server_version) - float(minimum_version_str) < -0.05:
36-
print(f"Example skipped as it requires DPF {minimum_version_str}.")
36+
print(f"Example skipped as it requires DPF {minimum_version_str}.", flush=True)
3737
continue
3838
try:
3939
out = subprocess.check_output([sys.executable, file])
4040
except subprocess.CalledProcessError as e:
4141
sys.stderr.write(str(e.args))
4242
if e.returncode != 3221225477:
43-
print(out)
43+
print(out, flush=True)
4444
raise e
45-
print("PASS")
45+
print("PASS", flush=True)

.github/workflows/examples.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ jobs:
132132
shell: bash
133133
working-directory: .ci
134134
run: |
135-
echo on
136135
python run_examples.py
137136
138137
- name: "Kill all servers"

examples/04-advanced/13-manage_licensing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
# license increment is used, and for what maximum duration.
105105

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

0 commit comments

Comments
 (0)