Skip to content

Commit

Permalink
Dont timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
fxgst committed Nov 19, 2024
1 parent 4b45304 commit 20498cd
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pocket_ic/pocket_ic_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,14 @@ def set_blob_store_entry(self, blob: bytes, compression: Optional[str]) -> str:
return response.text

def _get_url(self, port_file_path: int) -> str:
stop_at = time.time() + 10 # Wait for the port file for 10 seconds

while True:
if os.path.isfile(port_file_path):
with open(port_file_path, "r", encoding="utf-8") as port_file:
port = port_file.readline()
if "\n" in port:
return f"http://127.0.0.1:{port.strip()}"

time.sleep(0.02) # wait for 20ms

if time.time() > stop_at:
raise TimeoutError("PocketIC failed to start")

def _check_response(self, response: requests.Response):
self._check_status_code(response)
res_json = response.json()
Expand Down

0 comments on commit 20498cd

Please sign in to comment.