Skip to content

Commit

Permalink
Improve functional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzdaniel committed Sep 6, 2016
1 parent b4cae4c commit ef4d04d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_sphinxserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ def append(line, filename):
fh.write(line + '\n')

def get_page(url, timestamp):
for x in range(10): # give up to 3 sec to do the test
r = get(url)
if timestamp != r.headers['last-modified']:
break
sleep(0.3)
with Timeout(5, False):
while True:
r = get(url)
if timestamp != r.headers['last-modified']:
break
sleep(0.3)
return Ret(r.text, timestamp=r.headers['last-modified'])

# Test main header in rendered page
Expand Down

0 comments on commit ef4d04d

Please sign in to comment.