Skip to content

Commit 7a229b6

Browse files
sl0thentr0pyclaude
andcommitted
test: pass SENTRY_PYTHON_TEST_REDIS_HOST through tox
The workflow sets SENTRY_PYTHON_TEST_REDIS_HOST=redis for 3.6/3.7 container runs (since redis is a sibling service container, not on loopback), but tox strips env vars not listed in passenv. The celery beat tests therefore read the default 127.0.0.1, find nothing on loopback inside the python container, and hang in kombu's retry_over_time. Adding the var to passenv fixes it; un-skip the beat tests on py3.7. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f22fe86 commit 7a229b6

4 files changed

Lines changed: 9 additions & 16 deletions

File tree

scripts/populate_tox/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"deps": {
7474
"*": ["newrelic<10.17.0", "redis"],
7575
"py3.6": ["newrelic<8"],
76-
"py3.7": ["importlib-metadata<5.0", "pytest-timeout"],
76+
"py3.7": ["importlib-metadata<5.0"],
7777
},
7878
},
7979
"chalice": {

scripts/populate_tox/tox.jinja

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ setenv =
198198
common: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"
199199
gevent: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"
200200
201-
# Debug CI hangs for celery on py3.7: dump tracebacks and fail the test
202-
# rather than letting the job time out at the workflow level.
203-
py3.7-celery: PYTEST_ADDOPTS=--timeout=120 --timeout-method=thread
204-
205201
# TESTPATH definitions for test suites not managed by toxgen
206202
common: _TESTPATH=tests
207203
gevent: _TESTPATH=tests
@@ -226,6 +222,7 @@ passenv =
226222
SENTRY_PYTHON_TEST_POSTGRES_USER
227223
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD
228224
SENTRY_PYTHON_TEST_POSTGRES_NAME
225+
SENTRY_PYTHON_TEST_REDIS_HOST
229226
TESTPATH
230227
231228
basepython =

tests/integrations/celery/integration_tests/test_celery_beat_cron_monitoring.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def inner(propagate_traces=True, monitor_beat_tasks=False, **kwargs):
5454

5555

5656
@pytest.mark.skipif(
57-
sys.version_info < (3, 8),
58-
reason="Requires Python 3.8+ (py3.7 + container fork hits kombu/redis-py issue)",
57+
sys.version_info < (3, 7),
58+
reason="Requires Python 3.7+",
5959
)
6060
@pytest.mark.forked
6161
def test_explanation(celery_init, capture_envelopes):
@@ -96,8 +96,8 @@ def test_task():
9696

9797

9898
@pytest.mark.skipif(
99-
sys.version_info < (3, 8),
100-
reason="Requires Python 3.8+ (py3.7 + container fork hits kombu/redis-py issue)",
99+
sys.version_info < (3, 7),
100+
reason="Requires Python 3.7+",
101101
)
102102
@pytest.mark.forked
103103
def test_beat_task_crons_success(celery_init, capture_envelopes):
@@ -132,8 +132,8 @@ def test_task():
132132

133133

134134
@pytest.mark.skipif(
135-
sys.version_info < (3, 8),
136-
reason="Requires Python 3.8+ (py3.7 + container fork hits kombu/redis-py issue)",
135+
sys.version_info < (3, 7),
136+
reason="Requires Python 3.7+",
137137
)
138138
@pytest.mark.forked
139139
def test_beat_task_crons_error(celery_init, capture_envelopes):

tox.ini

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,6 @@ deps =
752752
celery: redis
753753
{py3.6}-celery: newrelic<8
754754
{py3.7}-celery: importlib-metadata<5.0
755-
{py3.7}-celery: pytest-timeout
756755

757756
dramatiq-v1.9.0: dramatiq==1.9.0
758757
dramatiq-v2.1.0: dramatiq==2.1.0
@@ -1000,10 +999,6 @@ setenv =
1000999
common: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"
10011000
gevent: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"
10021001

1003-
# Debug CI hangs for celery on py3.7: dump tracebacks and fail the test
1004-
# rather than letting the job time out at the workflow level.
1005-
py3.7-celery: PYTEST_ADDOPTS=--timeout=120 --timeout-method=thread
1006-
10071002
# TESTPATH definitions for test suites not managed by toxgen
10081003
common: _TESTPATH=tests
10091004
gevent: _TESTPATH=tests
@@ -1084,6 +1079,7 @@ passenv =
10841079
SENTRY_PYTHON_TEST_POSTGRES_USER
10851080
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD
10861081
SENTRY_PYTHON_TEST_POSTGRES_NAME
1082+
SENTRY_PYTHON_TEST_REDIS_HOST
10871083
TESTPATH
10881084

10891085
basepython =

0 commit comments

Comments
 (0)