diff --git a/ravendb/tests/test_base.py b/ravendb/tests/test_base.py index 0496cedf..966f708a 100644 --- a/ravendb/tests/test_base.py +++ b/ravendb/tests/test_base.py @@ -168,9 +168,10 @@ def server_path(self) -> str: @property def command_arguments(self) -> List[str]: + # No ServerUrl.Tcp: the server then listens for TCP on a free port of the ServerUrl host and tells + # clients which one, so a fixed port can never be taken by another process or a parallel run. return [ "--ServerUrl=http://127.0.0.1:0", - "--ServerUrl.Tcp=tcp://127.0.0.1:38881", "--Features.Availability=Experimental", ] @@ -185,12 +186,13 @@ def get_server_path(self) -> str: @property def command_arguments(self) -> List[str]: - https_server_url = self.https_server_url - tcp_server_url = https_server_url.replace("https", "tcp", 1).rsplit(":", 1)[0] + ":38882" + # TCP gets a free port picked by the OS, which the server reports to clients. It is bound to a single + # IPv4 address on purpose: given a host name such as "localhost", the server binds every address + # the name resolves to and keeps those it could bind, so an IPv4 client might find nothing there. return [ f"--Security.Certificate.Path={self.server_certificate_path}", - f"--ServerUrl={https_server_url}", - f"--ServerUrl.Tcp={tcp_server_url}", + f"--ServerUrl={self.https_server_url}", + "--ServerUrl.Tcp=tcp://127.0.0.1:0", ] @property