1 |
commit: 98536f208194197c521675e0d0072bdc599e015a |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 25 21:21:30 2022 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 25 23:40:38 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=98536f20 |
7 |
|
8 |
testOverallTimeoutWithException: handle TimeoutError |
9 |
|
10 |
Bug: https://bugs.gentoo.org/850127 |
11 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
12 |
|
13 |
lib/portage/tests/util/futures/test_retry.py | 7 ++++++- |
14 |
1 file changed, 6 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/lib/portage/tests/util/futures/test_retry.py b/lib/portage/tests/util/futures/test_retry.py |
17 |
index 8ea832136..cea3e83f5 100644 |
18 |
--- a/lib/portage/tests/util/futures/test_retry.py |
19 |
+++ b/lib/portage/tests/util/futures/test_retry.py |
20 |
@@ -176,8 +176,13 @@ class RetryTestCase(TestCase): |
21 |
asyncio.wait([decorated_func()], loop=loop) |
22 |
) |
23 |
self.assertEqual(len(done), 1) |
24 |
+ cause = done.pop().exception().__cause__ |
25 |
self.assertTrue( |
26 |
- isinstance(done.pop().exception().__cause__, SucceedNeverException) |
27 |
+ isinstance( |
28 |
+ cause, |
29 |
+ (asyncio.TimeoutError, SucceedNeverException), |
30 |
+ ), |
31 |
+ msg=f"Cause was {cause.__class__.__name__}", |
32 |
) |
33 |
|
34 |
def testOverallTimeoutWithTimeoutError(self): |