Skip to content

test: re-enable recoverable skipped tests (+ fix latent LazySpan bug)#723

Merged
wbarnha merged 2 commits into
claude/pypy-agen-cleanupfrom
claude/reenable-remaining-skipped-tests
Jul 21, 2026
Merged

test: re-enable recoverable skipped tests (+ fix latent LazySpan bug)#723
wbarnha merged 2 commits into
claude/pypy-agen-cleanupfrom
claude/reenable-remaining-skipped-tests

Conversation

@wbarnha

@wbarnha wbarnha commented Jul 20, 2026

Copy link
Copy Markdown
Member

Description

Re-enables the recoverable @pytest.mark.skip("Needs fixing" / "Fix is TBD") tests across the aiokafka driver, agents, and CLI, and fixes a real bug a skip was hiding. Independent, off master (this consolidates the former #719 + follow-up; #719 is closed in favour of this).

Re-enabled (test-only unless noted)

faust/transport/drivers/aiokafka.py + test_aiokafka.py

  • Real bug fix: _transform_span_lazy assigned the unbound LazySpan.finish to span.finish, so span.finish() crashed with missing 1 required positional argument: 'self'. Lazy spans run whenever tracing is enabled — a latent crash the 4 test_transform_span_* tests were masking. Bound it to the span. (source fix)
  • Test_VEP_stream_idle_* (2) — updated for the _make_slow_processing_error(msg, causes, setting, current_value) signature (the explanation is now baked into the message; log.error no longer gets those kwargs).
  • Test_VEP_no_fetch_since_start::test_timed_out — the fixture stamped a current poll timestamp so the NO_FETCH_SINCE_START branch could never fire; set state_value().timestamp = None (the real "no fetch ever sent" condition).
  • test__commit / __CommitFailedError / __IllegalStateError (3) — the mocked assignment() didn't contain TP1, so offsets were filtered to commit({}); point it at TP1. Also dropped the stale supervisor.wakeup() asserts (those calls were removed from _commit in 2020, commit 8d6758f1).

test_agent.pytest_execute_actor__cancelled_running ("Fix is TBD") passes as-is now (skip rot).

test_base.pytest_compat_option was asserting on a Mock; it now grabs the real callback closure from opt.kwargs["callback"] and checks its behaviour against faust/cli/base.py (ensure_object(State), value returned unchanged, stored on State only when the previous value is None and differs from the option default).

Left skipped — genuine source gap (flagged, not forced)

Test_VEP_no_response_since_start::test_timed_out and Test_VEP_no_recent_response::test_timed_out stay skipped with an accurate reason: SLOW_PROCESSING_NO_RESPONSE_SINCE_START / NO_RECENT_RESPONSE are defined in the driver but never emitted — the per-TP broker-response-staleness tracking was dropped, so the driver no longer warns when a broker stops responding to fetches (only when it stops being asked). Out of scope for a test-only change; worth a follow-up.

Verification

test_aiokafka.py + test_agent.py + test_base.py295 passed, 3 skipped, 0 failed on CPython; flake8/black/isort clean. Fixes were produced under adversarial faithfulness review (no gutted assertions; mocks stand in only for aiokafka/external).

🤖 Generated with Claude Code

@wbarnha
wbarnha force-pushed the claude/reenable-remaining-skipped-tests branch from 7056617 to f15a374 Compare July 20, 2026 21:12
@wbarnha wbarnha changed the title test: re-enable remaining recoverable skipped tests (aiokafka + CLI) test: re-enable recoverable skipped tests (+ fix latent LazySpan bug) Jul 20, 2026
@wbarnha
wbarnha changed the base branch from claude/reenable-skipped-tests to master July 20, 2026 21:13
wbarnha and others added 2 commits July 21, 2026 00:01
Sweep the suite's legacy `@pytest.mark.skip("Needs fixing")` tests and
re-enable the ones that can be made green, fixing a real bug found along the
way.

* fix(aiokafka): bind the lazy span's replacement `finish`.  `LazySpan.finish`
  was assigned to `span.finish` as a raw (unbound) function, so the later
  `span.finish()` call raised "missing 1 required positional argument:
  'self'".  Lazy spans are used whenever tracing is enabled, so this was a
  latent crash; the skipped `test_transform_span_*` tests were hiding it.
  Re-enables the four transform-span tests.
* test(aiokafka): the two stream-idle VEP tests called the 2-arg
  `_make_slow_processing_error`; it now takes `setting`/`current_value` and
  bakes the explanation into the message, so `log.error` no longer receives
  those as kwargs.  Updated the expectations and re-enabled them.
* test(agent): `test_execute_actor__cancelled_running` (was "Fix is TBD")
  passes as-is now -- skip rot -- re-enabled.

The remaining previously-skipped tests need per-test work beyond a re-enable
and stay skipped, but with precise reasons replacing "Needs fixing": the
fetch-timeout VEP asserts (driver behaviour drift) and the `_commit` mock
tests in test_aiokafka.py.  Tests needing live infrastructure or a
dependency API refresh (redis cache backend, rocksdb `Options`, the
transaction-manager mocks, the CLI compat-option test, tests/consistency's
stale aiokafka import) are left as they were.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
Continues the skipped-test sweep from the parent branch.

aiokafka (tests/unit/transport/drivers/test_aiokafka.py):
* Test_VEP_no_fetch_since_start::test_timed_out -- the base _consumer fixture
  stamps a current poll timestamp, so the NO_FETCH_SINCE_START branch (fires
  only when the partition has no poll timestamp yet) could never trigger. Set
  state_value().timestamp = None (the real "no fetch request ever sent"
  condition) and tighten the asserted tp. Now green.
* test__commit / __CommitFailedError / __IllegalStateError -- _commit filters
  offsets by self.assignment() before building the payload; the fixture's
  assignment didn't contain TP1, so every offset was filtered out
  (commit({})). Point the mocked assignment at TP1 so offsets flow through.
  Also dropped the stale supervisor.wakeup() assertions -- those calls were
  intentionally removed from _commit's error handlers in 2020 (commit
  8d6758f); the crash(exc)/returns-False assertions are kept.

CLI (tests/unit/cli/test_base.py):
* test_compat_option -- the old test asserted on a Mock (option(ctx)._callback
  is a Mock attribute, never 33). compat_option wires the real callback via the
  click `callback=` kwarg; grab it from opt.kwargs["callback"] and assert its
  actual behaviour against faust/cli/base.py: ensure_object(State), value
  returned unchanged, stored on the State only when the previous value is None
  and the value differs from the option default.

Two response-staleness VEP tests stay skipped, now with an accurate reason:
SLOW_PROCESSING_NO_RESPONSE_SINCE_START and SLOW_PROCESSING_NO_RECENT_RESPONSE
are defined in the driver but never emitted (the broker-response-staleness
tracking was dropped), so they cannot pass without re-adding that source
feature -- out of scope for a test-only change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
@wbarnha
wbarnha force-pushed the claude/reenable-remaining-skipped-tests branch from f15a374 to 6692060 Compare July 21, 2026 00:02
@wbarnha
wbarnha changed the base branch from master to claude/pypy-agen-cleanup July 21, 2026 00:02
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.81%. Comparing base (4ab51a5) to head (6692060).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           claude/pypy-agen-cleanup     #723      +/-   ##
============================================================
+ Coverage                     94.18%   94.81%   +0.63%     
============================================================
  Files                           104      104              
  Lines                         11154    11154              
  Branches                       1202     1202              
============================================================
+ Hits                          10505    10576      +71     
+ Misses                          548      482      -66     
+ Partials                        101       96       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wbarnha
wbarnha merged commit f45aca3 into claude/pypy-agen-cleanup Jul 21, 2026
24 checks passed
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