Skip to content

Commit

Permalink
Update test_poc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Faircloth committed Jun 29, 2019
1 parent 4cb64b1 commit 4dda2c1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/test_poc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def setup_splunk():
while True:
try:
c = client.connect(username="admin", password="Changed@11", host="splunk", port="8089")
break
except ConnectionRefusedError:
tried +=1
if tried>90:
Expand All @@ -40,12 +41,15 @@ def sendsingle(message):
server_address = ('sc4s', 514)

tried = 0
try:
sock.connect(server_address)
except:
if tried > 90:
raise
sleep(1)
while True:
try:
sock.connect(server_address)
break
except:
tried +=1
if tried > 90:
raise
sleep(1)

sock.sendall(str.encode(message))
sock.close()
Expand Down

0 comments on commit 4dda2c1

Please sign in to comment.