##// END OF EJS Templates
prevent race condition in purge_results test...
MinRK -
Show More
@@ -249,7 +249,14 b' class TestClient(ClusterTestCase):'
249 # ensure there are some tasks
249 # ensure there are some tasks
250 for i in range(5):
250 for i in range(5):
251 self.client[:].apply_sync(lambda : 1)
251 self.client[:].apply_sync(lambda : 1)
252 # Wait for the Hub to realise the result is done:
253 # This prevents a race condition, where we
254 # might purge a result the Hub still thinks is pending.
255 time.sleep(0.1)
256 rc2 = clientmod.Client(profile='iptest')
252 hist = self.client.hub_history()
257 hist = self.client.hub_history()
258 ahr = rc2.get_result([hist[-1]])
259 ahr.wait(10)
253 self.client.purge_results(hist[-1])
260 self.client.purge_results(hist[-1])
254 newhist = self.client.hub_history()
261 newhist = self.client.hub_history()
255 self.assertEquals(len(newhist)+1,len(hist))
262 self.assertEquals(len(newhist)+1,len(hist))
General Comments 0
You need to be logged in to leave comments. Login now