Start and stop single etcd and mock s3 servers globally in python tests

This commit is contained in:
Kirill Bulatov
2022-05-14 15:03:12 +03:00
committed by Kirill Bulatov
parent a884f4cf6b
commit f2881bbd8a
5 changed files with 87 additions and 79 deletions

View File

@@ -3,8 +3,10 @@ import os
import pathlib
import subprocess
import threading
import typing
from uuid import UUID
from fixtures.log_helper import log
from typing import Optional
import signal
import pytest
@@ -22,7 +24,7 @@ def new_pageserver_helper(new_pageserver_dir: pathlib.Path,
remote_storage_mock_path: pathlib.Path,
pg_port: int,
http_port: int,
broker: Etcd):
broker: Optional[Etcd]):
"""
cannot use ZenithPageserver yet because it depends on zenith cli
which currently lacks support for multiple pageservers
@@ -37,9 +39,11 @@ def new_pageserver_helper(new_pageserver_dir: pathlib.Path,
f"-c pg_distrib_dir='{pg_distrib_dir}'",
f"-c id=2",
f"-c remote_storage={{local_path='{remote_storage_mock_path}'}}",
f"-c broker_endpoints=['{broker.client_url()}']",
]
if broker is not None:
cmd.append(f"-c broker_endpoints=['{broker.client_url()}']", )
subprocess.check_output(cmd, text=True)
# actually run new pageserver