FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: wait for git daemon to listen before connecting by Vogtinator · Pull Request #2219 · gitpython-developers/GitPython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 10 additions & 2 deletions test/lib/helper.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import os
import os.path as osp
from stat import S_ISLNK, ST_MODE
import socket
import subprocess
import sys
import tempfile
Expand Down Expand Up @@ -218,8 +219,15 @@ def git_daemon_launched(base_path, ip, port):
base_path=base_path,
as_process=True,
)
# Yes, I know... fortunately, this is always going to work if sleep time is just large enough.
time.sleep(1.0 if sys.platform == "win32" else 0.5)

# Wait until git daemon listens for connections.
for _attempt in range(1, 30):
try:
socket.create_connection((ip, port), timeout=30).close()
break
except ConnectionRefusedError:
time.sleep(0.5)

except Exception as ex:
msg = textwrap.dedent(
"""
Expand Down
Loading

Back | FazBrowse Home | New Git URL