From: A. Jesse Jiryu Davis Date: Sat, 28 Feb 2015 18:40:32 +0000 (-0500) Subject: Restore LockTests.test_acquire_fifo. X-Git-Tag: v4.2.0b1~89^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b92232956bc57322965d2a669da39eed30c2cc4e;p=thirdparty%2Ftornado.git Restore LockTests.test_acquire_fifo. --- diff --git a/tornado/test/locks_test.py b/tornado/test/locks_test.py index 82504f992..fb022b6cb 100644 --- a/tornado/test/locks_test.py +++ b/tornado/test/locks_test.py @@ -382,20 +382,22 @@ class LockTests(AsyncTestCase): self.assertTrue(future.done()) @gen_test - def test_acquire_contended(self): + def test_acquire_fifo(self): lock = locks.Lock() self.assertTrue(lock.acquire().done()) N = 5 + history = [] @gen.coroutine - def f(): + def f(idx): with (yield lock.acquire()): - pass + history.append(idx) - futures = [f() for _ in range(N)] + futures = [f(i) for i in range(N)] self.assertFalse(any(future.done() for future in futures)) lock.release() yield futures + self.assertEqual(list(range(N)), history) @gen_test def test_acquire_timeout(self):