Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
wait for size change
Browse files Browse the repository at this point in the history
  • Loading branch information
binux committed Mar 8, 2014
1 parent d2eb39a commit c260081
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_20_new_project(self):
'rate': 1.0,
'burst': 10,
})
time.sleep(0.1)
time.sleep(0.2)
self.newtask_queue.put({
'taskid': 'taskid',
'project': 'test_project',
Expand All @@ -145,9 +145,12 @@ def test_20_new_project(self):
'age': 0,
},
})
time.sleep(0.1)
timeout = time.time() + 5
while self.rpc.size() != 1 and timeout > time.time():
time.sleep(0.1)
self.assertEqual(self.rpc.size(), 1)
self.assertEqual(self.rpc.counter('all', 'sum')['test_project']['pending'], 1)
self.assertEqual(self.rpc.counter('all', 'sum')['test_project']['task'], 1)

def test_30_update_project(self):
self.projectdb.update('test_project', status="DEBUG")
Expand Down

0 comments on commit c260081

Please sign in to comment.