mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-07-05 20:15:22 -04:00
is test_time_limit is failing because of timing?
give it up to ten seconds to mark the job finished
This commit is contained in:
parent
c52c16c260
commit
d4db8ba9bc
1 changed files with 5 additions and 1 deletions
|
@ -769,7 +769,7 @@ def test_time_limit(httpd):
|
||||||
rr = doublethink.Rethinker('localhost', db='brozzler')
|
rr = doublethink.Rethinker('localhost', db='brozzler')
|
||||||
frontier = brozzler.RethinkDbFrontier(rr)
|
frontier = brozzler.RethinkDbFrontier(rr)
|
||||||
|
|
||||||
# create a new job with three sites that could be crawled forever
|
# create a new job with one seed that could be crawled forever
|
||||||
job_conf = {'seeds': [{
|
job_conf = {'seeds': [{
|
||||||
'url': 'http://localhost:%s/infinite/foo/' % httpd.server_port,
|
'url': 'http://localhost:%s/infinite/foo/' % httpd.server_port,
|
||||||
'time_limit': 20}]}
|
'time_limit': 20}]}
|
||||||
|
@ -789,6 +789,10 @@ def test_time_limit(httpd):
|
||||||
assert sites[0].status == 'FINISHED_TIME_LIMIT'
|
assert sites[0].status == 'FINISHED_TIME_LIMIT'
|
||||||
|
|
||||||
# all sites finished so job should be finished too
|
# all sites finished so job should be finished too
|
||||||
|
start = time.time()
|
||||||
|
job.refresh()
|
||||||
|
while not job.status == 'FINISHED' and time.time() - start < 10:
|
||||||
|
time.sleep(0.5)
|
||||||
job.refresh()
|
job.refresh()
|
||||||
assert job.status == 'FINISHED'
|
assert job.status == 'FINISHED'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue