Last active
July 7, 2020 17:03
-
-
Save cpascual/6015b1c41548e1091997effaa182625c to your computer and use it in GitHub Desktop.
taurusbug-1118.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Automated test for https://github.com/taurus-org/taurus/issues/1118 | |
It requires docker-compose to be installed. | |
- If the bug is not present, it finishes in after counting to 30 and | |
printing "SUCCESS!" | |
- If the bug is present, crashes (non-zero exit value) at some point of the | |
count (~15) | |
Note: reproducibility is not 100%, but in my case it is at least 9/10 | |
""" | |
import taurus | |
import time | |
from pathlib import Path | |
import subprocess | |
def tgtest(action): | |
print("tangotest", action) | |
subprocess.run( | |
['make', action, 'tangotest'], | |
env={'CI_JOB_ID':'local'}, | |
cwd=Path(taurus.__file__).parent.parent.parent/"ci"/"docker-compose" | |
) | |
tgtest("start") | |
a = taurus.Attribute("tango://localhost:10000/sys/tg_test/1/double_spectrum") | |
tgtest("stop") | |
tgtest("start") | |
for i in range(30): | |
print(i, end=', ', flush=True) | |
time.sleep(1) | |
print("SUCCESS!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment