Commit 72dcf7de authored by Denis Bilenko's avatar Denis Bilenko

test__greenlet.py: fix TestStuff.test_wait_error

It failed because it depended on order in which greenlets spawned in the same iteration are executed.
With libevent, the order used to be the same as spawn() calls. With libev, the order is reversed.
parent e7032a3e
......@@ -381,15 +381,11 @@ class TestStuff(greentest.TestCase):
sleep(DELAY)
return 1
x = gevent.spawn(x)
z = gevent.spawn(lambda: 3)
y = gevent.spawn(lambda: getcurrent().throw(ExpectedError('test_wait_error')))
y.link(x)
x.link(y)
y.link(z)
z.link(y)
self.assertRaises(ExpectedError, gevent.joinall, [x, y, z], raise_error=True)
y.link(x)
self.assertRaises(ExpectedError, gevent.joinall, [x, y], raise_error=True)
self.assertRaises(greenlet.LinkedFailed, gevent.joinall, [x], raise_error=True)
self.assertEqual(z.get(), 3)
self.assertRaises(ExpectedError, gevent.joinall, [y], raise_error=True)
def test_joinall_exception_order(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment