Skip to content

Commit d3fd115

Browse files
Fix pgduck_server test deadlock (#7)
1 parent 693af2a commit d3fd115

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pgduck_server/tests/pytests/test_server_start.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def test_multiple_server_instances_on_duckdb_file_path_socket(clean_socket_path)
162162

163163
start_time = time.time()
164164
found_error = False
165-
while (time.time() - start_time) < 1: # loop at most 1 seconds
165+
while (time.time() - start_time) < 20: # loop at most 20 seconds
166166
try:
167167
# Check if there is any output indicating the server is ready
168168
line = output_queue_2.get_nowait()
@@ -182,10 +182,11 @@ def test_multiple_server_instances_on_duckdb_file_path_socket(clean_socket_path)
182182
assert has_duckdb_created_file("/tmp/data1.db")
183183

184184
# Clean up
185-
server1.terminate()
186-
server1.wait()
187-
server2.terminate()
188-
server2.wait()
185+
try:
186+
_, _ = server1.communicate(timeout=2)
187+
except subprocess.TimeoutExpired:
188+
server1.kill()
189+
_, _ = server1.communicate()
189190

190191

191192
def test_two_servers_different_ports(clean_socket_path):

0 commit comments

Comments
 (0)