MCPcopy Create free account
hub / github.com/apache/arrow / gcs_server

Function gcs_server

python/pyarrow/tests/conftest.py:239–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

237
238@pytest.fixture(scope='session')
239def gcs_server():
240 port = find_free_port()
241 env = os.environ.copy()
242 exe = 'storage-testbench'
243 args = [exe, '--port', str(port)]
244 proc = None
245 try:
246 # start server
247 proc = subprocess.Popen(args, env=env)
248 # Make sure the server is alive.
249 if proc.poll() is not None:
250 pytest.skip(f"Command {args} did not start server successfully!")
251 except OSError as e:
252 pytest.skip(f"Command {args} failed to execute: {e}")
253 else:
254 yield {
255 'connection': ('localhost', port),
256 'process': proc,
257 }
258 finally:
259 if proc is not None:
260 proc.kill()
261 proc.wait()
262
263
264@pytest.fixture(scope='session')

Callers

nothing calls this directly

Calls 3

find_free_portFunction · 0.90
copyMethod · 0.80
pollMethod · 0.80

Tested by

no test coverage detected