Skip to content

Commit

Permalink
Handle DynamoDB's starting time
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquev6 committed Oct 18, 2014
1 parent 097d773 commit a53bbb8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions LowVoltage/tests/dynamodb_local.py
Expand Up @@ -34,8 +34,16 @@ def __enter__(self):
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)

time.sleep(1)
assert self.__process.poll() is None
cnx = LowVoltage.Connection("us-west-2", LowVoltage.StaticCredentials("DummyKey", "DummySecret"), "http://localhost:65432/")

for i in range(10):
try:
cnx.request("ListTables", {})
break
except requests.ConnectionError:
time.sleep(1)
else:
raise Exception("Unable to connect to DynamoDBLocal")

def __exit__(self, *dummy):
self.__process.kill()
Expand Down

0 comments on commit a53bbb8

Please sign in to comment.