Changeset 7eb4233 in mod_gnutls for test/runtest.py
- Timestamp:
- Nov 28, 2020, 3:29:24 PM (21 months ago)
- Branches:
- asyncio, master
- Children:
- 65e66c9
- Parents:
- 32e62a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/runtest.py
r32e62a3 r7eb4233 16 16 # limitations under the License. 17 17 18 import asyncio 18 19 import contextlib 19 20 import os … … 85 86 86 87 87 def main(args):88 async def main(args): 88 89 # The Automake environment always provides srcdir, the default is 89 90 # for manual use. … … 161 162 f'http://127.0.0.1:{os.environ["MSVA_PORT"]}' 162 163 163 with contextlib.ExitStack() as service_stack:164 async with contextlib.AsyncExitStack() as service_stack: 164 165 if cleanup_callback: 165 166 service_stack.callback(cleanup_callback) 166 167 service_stack.enter_context( 167 168 lockfile('test.lock', nolock='MGS_NETNS_ACTIVE' in os.environ)) 168 service_stack.enter_context(ocsp.run())169 service_stack.enter_context(backend.run())170 service_stack.enter_context(msva.run())171 169 172 170 # TEST_SERVICE_MAX_WAIT is in milliseconds 173 171 wait_timeout = \ 174 172 int(os.environ.get('TEST_SERVICE_MAX_WAIT', 10000)) / 1000 175 for s in bg_services: 176 if s.condition(): 177 s.wait_ready(timeout=wait_timeout) 173 await asyncio.wait( 174 {asyncio.create_task( 175 service_stack.enter_async_context( 176 s.run(ready_timeout=wait_timeout))) 177 for s in bg_services}) 178 178 179 179 # special case: expected to fail in a few cases 180 service_stack.enter_context(apache.run())181 failed = a pache.wait_ready()180 await service_stack.enter_async_context(apache.run()) 181 failed = await apache.wait_ready() 182 182 if os.path.exists(os.path.join(testdir, 'fail.server')): 183 183 if failed: … … 252 252 stack.enter_context(contextlib.closing(args.log_connection)) 253 253 stack.enter_context(contextlib.closing(args.log_responses)) 254 main(args)254 asyncio.run(main(args))
Note: See TracChangeset
for help on using the changeset viewer.