Skip to content

Commit f794cb6

Browse files
committed
Fix tests and docs on CI
1 parent 48908ea commit f794cb6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
with:
1616
# require all of history to see all tagged versions' docs
1717
fetch-depth: 0
18+
submodules: true
1819

1920
- name: Set up Python
2021
uses: actions/setup-python@v2

tests/sim_asyncio_ioc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
async def callback(value):
2020
await asyncio.sleep(0.5)
2121
print("async update %s" % value)
22+
# Make sure it goes as epicsExit will not flush this for us
23+
sys.stdout.flush()
2224
sim_records.t_ai.set(value)
2325

2426
t_ao = builder.aOut('AO2', initial_value=12.45, on_update=callback)

tests/test_asyncio.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def asyncio_ioc():
1616
sim_ioc = os.path.join(os.path.dirname(__file__), "sim_asyncio_ioc.py")
1717
cmd = [sys.executable, sim_ioc, PV_PREFIX]
1818
proc = subprocess.Popen(
19-
cmd, env=dict(os.environ, PYTHONUNBUFFERED="1"),
20-
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
19+
cmd, stdin=subprocess.PIPE,
20+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
2121
yield proc
2222
proc.kill()
2323
out, err = proc.communicate()
@@ -45,8 +45,10 @@ async def test_asyncio_ioc(asyncio_ioc):
4545
assert await caget(PV_PREFIX + ":AI") == 12.34
4646
await asyncio.sleep(0.6)
4747
assert await caget(PV_PREFIX + ":AI") == 3.56
48+
# Wait for a bit longer for the print output to flush
49+
await asyncio.sleep(2)
4850
# Stop
49-
out, err = asyncio_ioc.communicate(b"exit\n", timeout=1)
51+
out, err = asyncio_ioc.communicate(b"exit\n", timeout=5)
5052
out = out.decode()
5153
err = err.decode()
5254
# Disconnect

0 commit comments

Comments
 (0)