commit: fb90fd3147b8a1b3dd5f620dc759650fec1b1d3c
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 23 13:27:17 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 23 13:30:04 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb90fd31
dev-python/redis-py: Restore running redis once
Since restarting redis did not resolve the test flakiness, return
to the simpler approach of starting it once for the whole test suite.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/redis-py/redis-py-4.0.2.ebuild | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/dev-python/redis-py/redis-py-4.0.2.ebuild
b/dev-python/redis-py/redis-py-4.0.2.ebuild
index d43d85672189..892a3038f10e 100644
--- a/dev-python/redis-py/redis-py-4.0.2.ebuild
+++ b/dev-python/redis-py/redis-py-4.0.2.ebuild
@@ -35,6 +35,10 @@ python_test() {
tests/test_pubsub.py::TestPubSubDeadlock::test_pubsub_deadlock
)
+ epytest -k "not redismod"
+}
+
+src_test() {
local redis_pid="${T}"/redis.pid
local redis_port=6379
local redis_test_config="
@@ -52,16 +56,8 @@ python_test() {
"${EPREFIX}"/usr/sbin/redis-server - <<< "${redis_test_config}" || die
# Run the tests
- epytest -k "not redismod"
+ distutils-r1_src_test
# Clean up afterwards
- local pid=$(<"${redis_pid}")
- kill "${pid}" || die
- local retries=10
- while [[ -f ${redis_pid} ]]; do
- sleep 1
- if [[ $(( retries-- )) -eq 0 ]]; then
- die "redis did not stop"
- fi
- done
+ kill "$(<"${redis_pid}")" || die
}