dev-cpp/drogon: fix race condition in tests

Closes: https://bugs.gentoo.org/868930
Signed-off-by: Ronny (tastytea) Gutbrod <gentoo@tastytea.de>
This commit is contained in:
Ronny (tastytea) Gutbrod
2022-09-08 17:52:50 +02:00
parent 120967ad12
commit 3969a15b3d
2 changed files with 39 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ DEPEND="${RDEPEND}
"
BDEPEND="doc? ( app-doc/doxygen )"
PATCHES=( "${FILESDIR}"/${P}-fix-tests-race-condition.patch )
DOCS=( CONTRIBUTING.md ChangeLog.md README.md README.zh-CN.md README.zh-TW.md )
src_unpack() {

View File

@@ -0,0 +1,37 @@
# Upstream PR (modified): <https://github.com/drogonframework/drogon/pull/1376>
# Bug: <https://bugs.gentoo.org/868930>
From eb0d322f40967883c8b1fb7aad7d00827c2f819c Mon Sep 17 00:00:00 2001
From: an-tao <antao2002@gmail.com>
Date: Thu, 8 Sep 2022 11:06:30 +0800
Subject: [PATCH] Fix a test bug when clients start before servers
---
lib/tests/RealIpResolverTest.cc | 1 +
lib/tests/main_CookieSameSite.cc | 1 +
2 files changed, 2 insertions(+)
diff --git a/lib/tests/RealIpResolverTest.cc b/lib/tests/RealIpResolverTest.cc
index e3d4cfb66..612174d45 100644
--- a/lib/tests/RealIpResolverTest.cc
+++ b/lib/tests/RealIpResolverTest.cc
@@ -139,6 +139,7 @@ int main(int argc, char **argv)
});
f1.get();
+ std::this_thread::sleep_for(std::chrono::milliseconds(200));
int testStatus = test::run(argc, argv);
app().getLoop()->queueInLoop([]() { app().quit(); });
thr.join();
diff --git a/lib/tests/main_CookieSameSite.cc b/lib/tests/main_CookieSameSite.cc
index b271e7a42..43f76198f 100644
--- a/lib/tests/main_CookieSameSite.cc
+++ b/lib/tests/main_CookieSameSite.cc
@@ -68,6 +68,7 @@ int main(int argc, char **argv)
});
f1.get();
+ std::this_thread::sleep_for(std::chrono::milliseconds(200));
int testStatus = test::run(argc, argv);
app().getLoop()->queueInLoop([]() { app().quit(); });
thr.join();