Added initial cluster setup.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s

This commit is contained in:
2025-06-17 16:50:54 -04:00
parent 2066084c13
commit f73d091dc2
5 changed files with 70 additions and 1 deletions

View File

@@ -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()