Skip to content

Commit

Permalink
Lint testing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Jan 18, 2022
1 parent 6db0173 commit 5d683d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ocs/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import subprocess
import coverage.data
import urllib.request
import docker

from urllib.error import URLError

Expand Down Expand Up @@ -40,7 +39,7 @@ def run_agent(cov):
stderr=subprocess.PIPE,
preexec_fn=os.setsid)

# wait for Agent to startup
# wait for Agent to startup
time.sleep(1)

yield
Expand Down Expand Up @@ -107,15 +106,16 @@ def check_crossbar_connection(port=18001, interval=5, max_attempts=6):
Notes:
For this check to work the crossbar server needs the `Node Info Service
<https://crossbar.io/docs/Node-Info-Service/>`_ running at the path /info.
<https://crossbar.io/docs/Node-Info-Service/>`_ running at the path
/info.
"""
attempts = 0

while attempts < max_attempts:
try:
code = urllib.request.urlopen(f"http://localhost:{port}/info").getcode()
url = f"http://localhost:{port}/info"
code = urllib.request.urlopen(url).getcode()
except (URLError, ConnectionResetError):
print("Crossbar server not online yet, waiting 5 seconds.")
time.sleep(interval)
Expand Down

0 comments on commit 5d683d6

Please sign in to comment.