From 0138c9bb8f73de895c962a8b0fda535feef7625c 2013-09-24 20:25:42 From: MinRK Date: 2013-09-24 20:25:42 Subject: [PATCH] test very short timeouts which should be guaranteed to fire while the task is pending --- diff --git a/IPython/parallel/tests/test_lbview.py b/IPython/parallel/tests/test_lbview.py index dd8f57a..4bdaf91 100644 --- a/IPython/parallel/tests/test_lbview.py +++ b/IPython/parallel/tests/test_lbview.py @@ -156,16 +156,24 @@ class TestLoadBalancedView(ClusterTestCase): def test_retries(self): view = self.view - view.timeout = 1 # prevent hang if this doesn't behave def fail(): assert False for r in range(len(self.client)-1): with view.temp_flags(retries=r): self.assertRaisesRemote(AssertionError, view.apply_sync, fail) - with view.temp_flags(retries=len(self.client), timeout=0.25): + with view.temp_flags(retries=len(self.client), timeout=0.1): self.assertRaisesRemote(error.TaskTimeout, view.apply_sync, fail) + def test_short_timeout(self): + view = self.view + def fail(): + import time + time.sleep(0.25) + assert False + with view.temp_flags(retries=1, timeout=0.01): + self.assertRaisesRemote(AssertionError, view.apply_sync, fail) + def test_invalid_dependency(self): view = self.view with view.temp_flags(after='12345'):