Skip to content

test(#11248): fix notification 4xx mock + conflict_resolver stale redis attr - #11273

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
fix-notification-4xx-test
Jul 8, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
fix-notification-4xx-test

Conversation

@mrveiss

@mrveiss mrveiss commented Jul 8, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

Two items from the #11248 test-remediation umbrella, both confirmed real
test-rot
(fail on both py3.10 and a py3.12 venv — not py-version artifacts;
the service code is correct in both cases):

  1. notification_service_test::test_raises_on_4xx_response — the mock built
    aiohttp.ClientResponseError(None, None, status=400); request_info=None
    makes str(exc) raise inside the except-block logger.error("…: %s", url, exc),
    crashing before the service's real raise re-surfaced the error, so
    pytest.raises(ClientResponseError) never saw it. Built a well-formed
    RequestInfo.
  2. test_conflict_resolver — ConflictResolver was migrated to
    AsyncRedisClientMixin (uses self._redis + _get_redis()), but the test
    still referenced the old _redis_client attribute (23×) → AttributeError +
    mock-redis injection that the code never read. Renamed _redis_client → _redis.

What Changed

  • notification_service_test.py — well-formed ClientResponseError (real RequestInfo).
  • test_conflict_resolver.py — _redis_client → _redis (23 occurrences).

Verification

  • notification: was 1 failed → 45 passed on both py3.10 and py3.12.
  • conflict_resolver: was AttributeError → 51 passed on py3.10 (init tests
    also pass on py3.12).
  • py_compile + black --check -l120 + isort clean on both.

Model Used

Opus 4.8 (1M context)

Refs #11248 (checks off notification_service_test + test_conflict_resolver).

…aise test passes (#11248)

test_raises_on_4xx_response constructed aiohttp.ClientResponseError(None, None,
status=400) — request_info=None makes str(exc) raise (it reads
request_info.real_url), so the except block's logger.error(..., exc) crashed with
a secondary exception before _send_webhook's real 're-raise' reached the caller,
and pytest.raises(ClientResponseError) never saw the expected error. The service
code is correct (log + raise); only the test's mock exception was malformed.

Construct a proper RequestInfo (url/method/headers/real_url) so str(exc) works.
Verified: notification_service_test now 45 passed on BOTH py3.10 and py3.12 (was
1 failed). One item off the #11248 test-remediation umbrella. black/isort clean.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss
mrveiss merged commit d912048 into Dev_new_gui Jul 8, 2026
36 checks passed
@mrveiss
mrveiss deleted the fix-notification-4xx-test branch July 8, 2026 07:45
@mrveiss mrveiss changed the title test(notification): fix malformed ClientResponseError mock in 4xx re-raise test (#11248) test(#11248): fix notification 4xx mock + conflict_resolver stale redis attr Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant