Skip to content

Commit 0b526a5

Browse files
committed
fix: Run git server in thread
1 parent 6193268 commit 0b526a5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/hooks/test_git_hook.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Unit test module for DbtGitFSHook."""
22

3-
import multiprocessing
43
import os
54
import platform
65
import shutil
6+
import threading
77
import typing
88

99
import pytest
@@ -343,14 +343,15 @@ def git_server(repo, repo_name):
343343
backend = DictBackend({repo_name.encode(): repo})
344344
dul_server = TCPGitServer(backend, b"localhost", 0)
345345

346-
proc = multiprocessing.Process(target=dul_server.serve)
347-
proc.start()
346+
server_thread = threading.Thread(target=dul_server.serve)
347+
server_thread.start()
348348

349349
server_address, server_port = dul_server.socket.getsockname()
350350

351351
yield server_address, server_port
352352

353-
proc.terminate()
353+
dul_server.shutdown()
354+
server_thread.join()
354355

355356

356357
@no_git_local_server

0 commit comments

Comments
 (0)