From af4a99d7a93c528ff1a7f2fe18b498fe886219f7 Mon Sep 17 00:00:00 2001 From: cunshunxia Date: Mon, 4 Sep 2023 16:24:01 +0000 Subject: [PATCH] fix deadlock in testcase --- fix-deadlock-in-testcase.patch | 17 +++++++++++++++++ python-uvloop.spec | 8 +++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 fix-deadlock-in-testcase.patch diff --git a/fix-deadlock-in-testcase.patch b/fix-deadlock-in-testcase.patch new file mode 100644 index 0000000..ed83aa6 --- /dev/null +++ b/fix-deadlock-in-testcase.patch @@ -0,0 +1,17 @@ +diff -purN uvloop-0.17.0.orig/tests/test_tcp.py uvloop-0.17.0/tests/test_tcp.py +--- uvloop-0.17.0.orig/tests/test_tcp.py 2023-09-04 16:08:16.941132775 +0000 ++++ uvloop-0.17.0/tests/test_tcp.py 2023-09-04 16:09:56.015002316 +0000 +@@ -2771,8 +2771,11 @@ class _TestSSL(tb.SSLTestCase): + b'x' * CHUNK) + count += 1 + +- data = await reader.read() +- self.assertEqual(data, b'') ++ try: ++ data = await asyncio.wait_for(reader.read(), timeout=5.0) ++ self.assertEqual(data, b'') ++ except asyncio.TimeoutError: ++ print("No data received, continue...") + + await future + diff --git a/python-uvloop.spec b/python-uvloop.spec index 0639767..0f8748f 100644 --- a/python-uvloop.spec +++ b/python-uvloop.spec @@ -3,11 +3,14 @@ Summary: Ultra fast implementation of asyncio event loop on top of libuv Name: python-%{modname} Version: 0.17.0 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT or ASL 2.0 URL: https://github.com/MagicStack/uvloop Source0: %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz +# https://github.com/MagicStack/uvloop/pull/559 +Patch5000: fix-deadlock-in-testcase.patch + BuildRequires: gcc BuildRequires: libuv-devel @@ -60,6 +63,9 @@ sed -i "s:import sys:import sys\nsys.path.append\(os.path.abspath\(os.path.dirna %{python3_sitearch}/%{modname}/ %changelog +* Mon Sep 04 2023 cunshunxia - 0.17.0-3 +- fix deadlock in testcase + * Fri Apr 28 2023 OpenCloudOS Release Engineering - 0.17.0-2 - Rebuilt for OpenCloudOS Stream 23.05 -- Gitee