Skip to content

Commit c260081

Browse files
committed
wait for size change
1 parent d2eb39a commit c260081

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/test_scheduler.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_20_new_project(self):
130130
'rate': 1.0,
131131
'burst': 10,
132132
})
133-
time.sleep(0.1)
133+
time.sleep(0.2)
134134
self.newtask_queue.put({
135135
'taskid': 'taskid',
136136
'project': 'test_project',
@@ -145,9 +145,12 @@ def test_20_new_project(self):
145145
'age': 0,
146146
},
147147
})
148-
time.sleep(0.1)
148+
timeout = time.time() + 5
149+
while self.rpc.size() != 1 and timeout > time.time():
150+
time.sleep(0.1)
149151
self.assertEqual(self.rpc.size(), 1)
150152
self.assertEqual(self.rpc.counter('all', 'sum')['test_project']['pending'], 1)
153+
self.assertEqual(self.rpc.counter('all', 'sum')['test_project']['task'], 1)
151154

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy