We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ad5aeb commit 6be454bCopy full SHA for 6be454b
test/test.py
@@ -0,0 +1,28 @@
1
+#!/usr/bin/python3
2
+
3
+import asyncio
4
+import sys
5
+import time
6
7
+async def run(repetitions):
8
+ cmd = './client'
9
+ to_wait = []
10
+ # stress test, simulate multiple concurrent connections
11
+ for i in range(repetitions):
12
+ to_wait.append(await asyncio.create_subprocess_shell(
13
+ cmd,
14
+ stdout= asyncio.subprocess.DEVNULL,
15
+ stderr= asyncio.subprocess.DEVNULL
16
+ ))
17
+ print(f"{i} executed")
18
19
20
+ await to_wait[i].communicate()
21
+ print(f'[{cmd!r} exited with {to_wait[i].returncode}]')
22
23
+if __name__ == '__main__':
24
+ if len(sys.argv) < 2:
25
+ repetitions = 10
26
+ else:
27
+ repetitions = int(sys.argv[1])
28
+ asyncio.run(run(repetitions))
0 commit comments