1 |
commit: fb90fd3147b8a1b3dd5f620dc759650fec1b1d3c |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 23 13:27:17 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 23 13:30:04 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb90fd31 |
7 |
|
8 |
dev-python/redis-py: Restore running redis once |
9 |
|
10 |
Since restarting redis did not resolve the test flakiness, return |
11 |
to the simpler approach of starting it once for the whole test suite. |
12 |
|
13 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
14 |
|
15 |
dev-python/redis-py/redis-py-4.0.2.ebuild | 16 ++++++---------- |
16 |
1 file changed, 6 insertions(+), 10 deletions(-) |
17 |
|
18 |
diff --git a/dev-python/redis-py/redis-py-4.0.2.ebuild b/dev-python/redis-py/redis-py-4.0.2.ebuild |
19 |
index d43d85672189..892a3038f10e 100644 |
20 |
--- a/dev-python/redis-py/redis-py-4.0.2.ebuild |
21 |
+++ b/dev-python/redis-py/redis-py-4.0.2.ebuild |
22 |
@@ -35,6 +35,10 @@ python_test() { |
23 |
tests/test_pubsub.py::TestPubSubDeadlock::test_pubsub_deadlock |
24 |
) |
25 |
|
26 |
+ epytest -k "not redismod" |
27 |
+} |
28 |
+ |
29 |
+src_test() { |
30 |
local redis_pid="${T}"/redis.pid |
31 |
local redis_port=6379 |
32 |
local redis_test_config=" |
33 |
@@ -52,16 +56,8 @@ python_test() { |
34 |
"${EPREFIX}"/usr/sbin/redis-server - <<< "${redis_test_config}" || die |
35 |
|
36 |
# Run the tests |
37 |
- epytest -k "not redismod" |
38 |
+ distutils-r1_src_test |
39 |
|
40 |
# Clean up afterwards |
41 |
- local pid=$(<"${redis_pid}") |
42 |
- kill "${pid}" || die |
43 |
- local retries=10 |
44 |
- while [[ -f ${redis_pid} ]]; do |
45 |
- sleep 1 |
46 |
- if [[ $(( retries-- )) -eq 0 ]]; then |
47 |
- die "redis did not stop" |
48 |
- fi |
49 |
- done |
50 |
+ kill "$(<"${redis_pid}")" || die |
51 |
} |