77
88MAX_CONTAINER_STARTUP_TIME = 120 # Increased from 30 to 120 seconds for slower systems
99
10+
1011# Check if a local TerminusDB test server is already running
1112def is_local_server_running ():
1213 """Check if local TerminusDB server is running at http://127.0.0.1:6363"""
@@ -69,13 +70,13 @@ def docker_url_jwt(pytestconfig):
6970 # we are using subprocess in case we need to access some of the outputs
7071 # most likely
7172 jwt_token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InRlc3RrZXkifQ.eyJodHRwOi8vdGVybWludXNkYi5jb20vc2NoZW1hL3N5c3RlbSNhZ2VudF9uYW1lIjoiYWRtaW4iLCJodHRwOi8vdGVybWludXNkYi5jb20vc2NoZW1hL3N5c3RlbSN1c2VyX2lkZW50aWZpZXIiOiJhZG1pbkB1c2VyLmNvbSIsImlzcyI6Imh0dHBzOi8vdGVybWludXNodWIuZXUuYXV0aDAuY29tLyIsInN1YiI6ImFkbWluIiwiYXVkIjpbImh0dHBzOi8vdGVybWludXNodWIvcmVnaXN0ZXJVc2VyIiwiaHR0cHM6Ly90ZXJtaW51c2h1Yi5ldS5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTkzNzY5MTgzLCJhenAiOiJNSkpuZEdwMHpVZE03bzNQT1RRUG1SSkltWTJobzBhaSIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwifQ.Ru03Bi6vSIQ57bC41n6fClSdxlb61m0xX6Q34Yh91gql0_CyfYRWTuqzqPMFoCefe53hPC5E-eoSFdID_u6w1ih_pH-lTTqus9OWgi07Qou3QNs8UZBLiM4pgLqcBKs0N058jfg4y6h9GjIBGVhX9Ni2ez3JGNcz1_U45BhnreE"
72-
73+
7374 # Check if JWT server is already running (port 6367)
7475 if is_jwt_server_running ():
7576 print ("\n ✓ Using existing JWT Docker TerminusDB server at http://127.0.0.1:6367" )
7677 yield ("http://127.0.0.1:6367" , jwt_token )
7778 return # Don't clean up - server was already running
78-
79+
7980 pytestconfig .getoption ("docker_compose" )
8081 output = subprocess .run (
8182 [
@@ -138,7 +139,7 @@ def docker_url(pytestconfig):
138139 """
139140 Provides a TerminusDB server URL for integration tests.
140141 Prefers local test server if running, otherwise starts Docker container.
141-
142+
142143 NOTE: This fixture returns just the URL. Tests expect AUTOLOGIN mode (no authentication).
143144 If using local server with authentication, use TERMINUSDB_AUTOLOGIN=true when starting it.
144145 """
@@ -149,13 +150,13 @@ def docker_url(pytestconfig):
149150 print (" Or use: TERMINUSDB_SERVER_AUTOLOGIN=true ./tests/terminusdb-test-server.sh restart" )
150151 yield "http://127.0.0.1:6363"
151152 return # Don't clean up - server was already running
152-
153+
153154 # Check if Docker container is already running (port 6366)
154155 if is_docker_server_running ():
155156 print ("\n ✓ Using existing Docker TerminusDB server at http://127.0.0.1:6366" )
156157 yield "http://127.0.0.1:6366"
157158 return # Don't clean up - server was already running
158-
159+
159160 # No server found, start Docker container
160161 print ("\n ⚠ No server found, starting Docker container with AUTOLOGIN..." )
161162 pytestconfig .getoption ("docker_compose" )
0 commit comments