Added initial cluster setup.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Starts and runs releasse version of MoreThanText server."""
|
||||
|
||||
from asyncio import create_subprocess_exec
|
||||
from socket import AF_INET, SOCK_STREAM, socket
|
||||
from pathlib import Path
|
||||
from release_tests.support import ADDR, get_port
|
||||
|
||||
@@ -24,3 +25,13 @@ class MTTServer:
|
||||
async def start(self):
|
||||
"""Starts the server."""
|
||||
self.server = await create_subprocess_exec(*self.cmd)
|
||||
# delays the return untul the serverr is responding.
|
||||
with socket(AF_INET, SOCK_STREAM) as soc:
|
||||
while soc.connect_ex((ADDR, self.port)) != 0:
|
||||
continue
|
||||
|
||||
async def stop(self):
|
||||
"""Stops the server."""
|
||||
if self.server:
|
||||
self.server.terminate()
|
||||
await self.server.wait()
|
||||
|
||||
Reference in New Issue
Block a user