1 |
commit: 3969a15b3da3dd8fe29a7451f013c7c92f61860b |
2 |
Author: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea <DOT> de> |
3 |
AuthorDate: Thu Sep 8 15:52:50 2022 +0000 |
4 |
Commit: Ronny Gutbrod <gentoo <AT> tastytea <DOT> de> |
5 |
CommitDate: Thu Sep 8 15:56:36 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3969a15b |
7 |
|
8 |
dev-cpp/drogon: fix race condition in tests |
9 |
|
10 |
Closes: https://bugs.gentoo.org/868930 |
11 |
Signed-off-by: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea.de> |
12 |
|
13 |
dev-cpp/drogon/drogon-1.8.0-r1.ebuild | 2 ++ |
14 |
.../drogon-1.8.0-fix-tests-race-condition.patch | 37 ++++++++++++++++++++++ |
15 |
2 files changed, 39 insertions(+) |
16 |
|
17 |
diff --git a/dev-cpp/drogon/drogon-1.8.0-r1.ebuild b/dev-cpp/drogon/drogon-1.8.0-r1.ebuild |
18 |
index 784892098..a884fc440 100644 |
19 |
--- a/dev-cpp/drogon/drogon-1.8.0-r1.ebuild |
20 |
+++ b/dev-cpp/drogon/drogon-1.8.0-r1.ebuild |
21 |
@@ -41,6 +41,8 @@ DEPEND="${RDEPEND} |
22 |
" |
23 |
BDEPEND="doc? ( app-doc/doxygen )" |
24 |
|
25 |
+PATCHES=( "${FILESDIR}"/${P}-fix-tests-race-condition.patch ) |
26 |
+ |
27 |
DOCS=( CONTRIBUTING.md ChangeLog.md README.md README.zh-CN.md README.zh-TW.md ) |
28 |
|
29 |
src_unpack() { |
30 |
|
31 |
diff --git a/dev-cpp/drogon/files/drogon-1.8.0-fix-tests-race-condition.patch b/dev-cpp/drogon/files/drogon-1.8.0-fix-tests-race-condition.patch |
32 |
new file mode 100644 |
33 |
index 000000000..efeeb5a3d |
34 |
--- /dev/null |
35 |
+++ b/dev-cpp/drogon/files/drogon-1.8.0-fix-tests-race-condition.patch |
36 |
@@ -0,0 +1,37 @@ |
37 |
+# Upstream PR (modified): <https://github.com/drogonframework/drogon/pull/1376> |
38 |
+# Bug: <https://bugs.gentoo.org/868930> |
39 |
+ |
40 |
+From eb0d322f40967883c8b1fb7aad7d00827c2f819c Mon Sep 17 00:00:00 2001 |
41 |
+From: an-tao <antao2002@×××××.com> |
42 |
+Date: Thu, 8 Sep 2022 11:06:30 +0800 |
43 |
+Subject: [PATCH] Fix a test bug when clients start before servers |
44 |
+ |
45 |
+--- |
46 |
+ lib/tests/RealIpResolverTest.cc | 1 + |
47 |
+ lib/tests/main_CookieSameSite.cc | 1 + |
48 |
+ 2 files changed, 2 insertions(+) |
49 |
+ |
50 |
+diff --git a/lib/tests/RealIpResolverTest.cc b/lib/tests/RealIpResolverTest.cc |
51 |
+index e3d4cfb66..612174d45 100644 |
52 |
+--- a/lib/tests/RealIpResolverTest.cc |
53 |
++++ b/lib/tests/RealIpResolverTest.cc |
54 |
+@@ -139,6 +139,7 @@ int main(int argc, char **argv) |
55 |
+ }); |
56 |
+ |
57 |
+ f1.get(); |
58 |
++ std::this_thread::sleep_for(std::chrono::milliseconds(200)); |
59 |
+ int testStatus = test::run(argc, argv); |
60 |
+ app().getLoop()->queueInLoop([]() { app().quit(); }); |
61 |
+ thr.join(); |
62 |
+diff --git a/lib/tests/main_CookieSameSite.cc b/lib/tests/main_CookieSameSite.cc |
63 |
+index b271e7a42..43f76198f 100644 |
64 |
+--- a/lib/tests/main_CookieSameSite.cc |
65 |
++++ b/lib/tests/main_CookieSameSite.cc |
66 |
+@@ -68,6 +68,7 @@ int main(int argc, char **argv) |
67 |
+ }); |
68 |
+ |
69 |
+ f1.get(); |
70 |
++ std::this_thread::sleep_for(std::chrono::milliseconds(200)); |
71 |
+ int testStatus = test::run(argc, argv); |
72 |
+ app().getLoop()->queueInLoop([]() { app().quit(); }); |
73 |
+ thr.join(); |