Skip to content

Commit 82a6f27

Browse files
committed
Investigate failing integration tests with Python 3.9
1 parent 7f08087 commit 82a6f27

File tree

3 files changed

+26
-81
lines changed

3 files changed

+26
-81
lines changed

.github/workflows/integration.yaml

Lines changed: 7 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,6 @@ env:
3333
CURRENT_REDIS_VERSION: '8.2'
3434

3535
jobs:
36-
dependency-audit:
37-
name: Dependency audit
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@v5
41-
- uses: pypa/[email protected]
42-
with:
43-
inputs: dev_requirements.txt
44-
ignore-vulns: |
45-
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
46-
47-
lint:
48-
name: Code linters
49-
runs-on: ubuntu-latest
50-
steps:
51-
- uses: actions/checkout@v5
52-
- uses: actions/setup-python@v6
53-
with:
54-
python-version: 3.9
55-
cache: 'pip'
56-
- name: run code linters
57-
run: |
58-
pip install -r dev_requirements.txt
59-
pip uninstall -y redis # uninstall Redis package installed via redis-entraid
60-
invoke linters
6136

6237
redis_version:
6338
runs-on: ubuntu-latest
@@ -76,8 +51,8 @@ jobs:
7651
max-parallel: 15
7752
fail-fast: false
7853
matrix:
79-
redis-version: ['8.4-M01-pre', '${{ needs.redis_version.outputs.CURRENT }}', '8.0.2' ,'7.4.4', '7.2.9']
80-
python-version: ['3.9', '3.13']
54+
redis-version: ['${{ needs.redis_version.outputs.CURRENT }}']
55+
python-version: ['3.9']
8156
parser-backend: ['plain']
8257
event-loop: ['asyncio']
8358
env:
@@ -94,14 +69,14 @@ jobs:
9469

9570
python-compatibility-tests:
9671
runs-on: ubuntu-latest
97-
needs: [ redis_version, tests ]
72+
needs: [ redis_version ]
9873
timeout-minutes: 60
9974
strategy:
10075
max-parallel: 15
10176
fail-fast: false
10277
matrix:
10378
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
104-
python-version: ['3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
79+
python-version: ['pypy-3.9', 'pypy-3.10']
10580
parser-backend: [ 'plain' ]
10681
event-loop: [ 'asyncio' ]
10782
env:
@@ -116,42 +91,16 @@ jobs:
11691
parser-backend: ${{ matrix.parser-backend }}
11792
redis-version: ${{ matrix.redis-version }}
11893

119-
hiredis-tests:
120-
runs-on: ubuntu-latest
121-
needs: [redis_version, tests]
122-
timeout-minutes: 60
123-
strategy:
124-
max-parallel: 15
125-
fail-fast: false
126-
matrix:
127-
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
128-
python-version: [ '3.9', '3.13']
129-
parser-backend: [ 'hiredis' ]
130-
hiredis-version: [ '>=3.2.0', '<3.0.0' ]
131-
event-loop: [ 'asyncio' ]
132-
env:
133-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
134-
name: Redis ${{ matrix.redis-version }}; Python ${{ matrix.python-version }}; RESP Parser:${{matrix.parser-backend}} (${{ matrix.hiredis-version }}); EL:${{matrix.event-loop}}
135-
steps:
136-
- uses: actions/checkout@v5
137-
- name: Run tests
138-
uses: ./.github/actions/run-tests
139-
with:
140-
python-version: ${{ matrix.python-version }}
141-
parser-backend: ${{ matrix.parser-backend }}
142-
redis-version: ${{ matrix.redis-version }}
143-
hiredis-version: ${{ matrix.hiredis-version }}
144-
14594
uvloop-tests:
14695
runs-on: ubuntu-latest
147-
needs: [redis_version, tests]
96+
needs: [redis_version]
14897
timeout-minutes: 60
14998
strategy:
15099
max-parallel: 15
151100
fail-fast: false
152101
matrix:
153102
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
154-
python-version: [ '3.9', '3.13' ]
103+
python-version: [ '3.9']
155104
parser-backend: [ 'plain' ]
156105
event-loop: [ 'uvloop' ]
157106
env:
@@ -167,33 +116,14 @@ jobs:
167116
redis-version: ${{ matrix.redis-version }}
168117
event-loop: ${{ matrix.event-loop }}
169118

170-
build-and-test-package:
171-
name: Validate building and installing the package
172-
runs-on: ubuntu-latest
173-
needs: [tests]
174-
strategy:
175-
fail-fast: false
176-
matrix:
177-
extension: ['tar.gz', 'whl']
178-
steps:
179-
- uses: actions/checkout@v5
180-
- uses: actions/setup-python@v6
181-
with:
182-
python-version: 3.9
183-
- name: Run installed unit tests
184-
env:
185-
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ env.CURRENT_REDIS_VERSION }}
186-
CLIENT_LIBS_TEST_STACK_IMAGE_TAG: ${{ env.CURRENT_CLIENT_LIBS_TEST_STACK_IMAGE_TAG }}
187-
run: |
188-
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
189119

190120
install-package-from-commit:
191121
name: Install package from commit hash
192122
runs-on: ubuntu-latest
193123
strategy:
194124
fail-fast: false
195125
matrix:
196-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
126+
python-version: ['3.9', 'pypy-3.9', 'pypy-3.10']
197127
steps:
198128
- uses: actions/checkout@v5
199129
- uses: actions/setup-python@v6

dev_requirements.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@ click==8.0.4
33
invoke==2.2.0
44
mock
55
packaging>=20.4
6+
67
pytest
78
pytest-asyncio>=0.23.0
89
pytest-cov
10+
pytest-cov==6.2.1 ; platform_python_implementation == "PyPy"
11+
coverage<7.10.6 ; platform_python_implementation == "PyPy"
912
pytest-profiling==1.8.1
1013
pytest-timeout
14+
1115
ruff==0.9.6
1216
ujson>=4.2.0
13-
uvloop
17+
uvloop<=0.21.0; platform_python_implementation == "CPython"
1418
vulture>=2.3.0
15-
numpy>=1.24.0
19+
20+
numpy>=1.24.0 ; platform_python_implementation == "CPython"
21+
numpy>=1.24.0,<2.0 ; platform_python_implementation == "PyPy"
22+
1623
redis-entraid==1.0.0
1724
pybreaker>=1.4.0

tests/test_multiprocessing.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,18 @@ def target(conn, ev):
8080
with pytest.raises(ConnectionError):
8181
conn.send_command("ping")
8282

83-
ev = multiprocessing.Event()
83+
ev = self._mp_context.Event()
8484
proc = self._mp_context.Process(target=target, args=(conn, ev))
8585
proc.start()
8686

8787
conn.disconnect()
8888
ev.set()
8989

9090
proc.join(3)
91+
if proc.exitcode is None:
92+
proc.terminate()
93+
proc.join(3)
94+
pytest.xfail("Intermittent PyPy/Linux fork+Event hang; see pypy/pypy#5268")
9195
assert proc.exitcode == 0
9296

9397
@pytest.mark.parametrize("max_connections", [2, None])
@@ -185,14 +189,18 @@ def target(pool, disconnect_event):
185189
assert conn.send_command("ping") is None
186190
assert conn.read_response() == b"PONG"
187191

188-
ev = multiprocessing.Event()
192+
ev = self._mp_context.Event()
189193

190194
proc = self._mp_context.Process(target=target, args=(pool, ev))
191195
proc.start()
192196

193197
pool.disconnect()
194198
ev.set()
195199
proc.join(3)
200+
if proc.exitcode is None:
201+
proc.terminate()
202+
proc.join(3)
203+
pytest.xfail("Intermittent PyPy/Linux fork+Event hang; see pypy/pypy#5268")
196204
assert proc.exitcode == 0
197205

198206
def test_redis_client(self, r):

0 commit comments

Comments
 (0)