Skip to content

Clear the warnings the check workflow prints - #726

Draft
owenpearson wants to merge 7 commits into
uts/deviations-correctionsfrom
fix/ci-warnings
Draft

owenpearson wants to merge 7 commits into
uts/deviations-correctionsfrom
fix/ci-warnings

Conversation

@owenpearson

Copy link
Copy Markdown
Member

Clears the warnings printed by the check workflow. Stacked on #725.

Changes

  • fix: cancel a connect attempt when its transport is torn down. When the transition or suspend timer ends a connection attempt, disconnect_transport() disposed the transport but left connect_base() awaiting a future that only that transport could settle. Each such attempt leaked a pending task, which surfaced as the 80–357 Task was destroyed but it is pending! lines at the end of every job. An attempt abandoned mid-auth also resumed when auth answered and connected from DISCONNECTED. disconnect_transport() now cancels the in-flight attempt, as close_impl() and on_closed() already do. Two regression tests are in test/unit/connectionmanager_test.py.
  • fix: use Logger.warning instead of the deprecated Logger.warn. Two call sites, plus ruff's G010 rule so new ones fail lint.
  • test: resolve the mocked publish POST to a real Response. encoders_test.py patched Http.post with a bare AsyncMock, so publish_messages' synchronous to_native() call produced a never-awaited coroutine (11 RuntimeWarnings) and the response parsing never ran.
  • test: dispose the transport before forcing DISCONNECTED in the queueing tests. Two tests in realtimechannel_publish_test.py forced DISCONNECTED with the transport still live; the immediate reconnect orphaned the old websocket, whose coroutines were garbage-collected after the event loop closed (PytestUnraisableExceptionWarning).
  • ci: move the pinned actions onto the Node 24 runtime. checkout v7, setup-python v7, cache v6, upload-artifact v7, download-artifact v8.

Testing

  • ruff check passes.
  • pytest test/unit test/uts (Python 3.13): 1095 passed, no Task was destroyed lines (558 across test/uts before).
  • encoders_test.py, its generated sync mirror and realtimechannel_publish_test.py with -W error::RuntimeWarning: 138 passed, no unraisable or never-awaited warnings.
  • Not verified locally: Python 3.8 under setup-python v7, and the release workflow's artifact steps, which only run on release.

🤖 Generated with Claude Code

owenpearson and others added 5 commits September 30, 2026 16:57
When the transition or suspend timer ends a connection attempt, the
transport it was opening is disposed, but connect_base() is left
awaiting a future that only that transport's 'connected' or 'failed'
events settle. Neither fires once the transport is disposed, nor when
the attempt failed with an error ws_connect does not catch, so each such
attempt leaves a pending task for the garbage collector to destroy
("Task was destroyed but it is pending!"). An attempt abandoned while
still authenticating resumes when auth answers, and connects from
DISCONNECTED.

disconnect_transport() cancels the in-flight attempt alongside disposing
its transport, as close_impl() and on_closed() already do.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Logger.warn emits a DeprecationWarning. Replace the two remaining calls
in the realtime channel and connection manager, and enable ruff's G010
rule so new ones are caught by lint.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The encoder tests patched Http.post with a bare AsyncMock, whose default
return value is itself an AsyncMock. publish_messages calls the
synchronous Response.to_native() on that value, which produced a
coroutine that was never awaited and emitted a RuntimeWarning for each
of the 11 tests.

The patched post resolves to an empty 201 Response, so the response
parsing in publish_messages runs as it does against a real server.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ng tests

test_fail_on_disconnected_when_queue_messages_false and
test_queue_on_disconnected_when_queue_messages_true forced DISCONNECTED
while the transport was still connected. The immediate reconnect replaced
the transport without closing it, so its websocket tasks were still
pending when the test's event loop closed, and garbage collection later
surfaced them as PytestUnraisableExceptionWarning in whichever test was
running.

Dispose the transport first, as the other simulated-disconnect tests do.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
checkout, setup-python, cache, upload-artifact and download-artifact
were pinned to majors that target Node 20, which GitHub warns about and
forces onto Node 24. Pin the latest majors, which run on Node 24
natively.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

owenpearson and others added 2 commits October 1, 2026 13:13
Python 3.14 deprecates asyncio.iscoroutinefunction, and the event
emitter, Timer and is_callable_or_coroutine called it on every listener
registration. is_coroutine_function keeps its semantics on every
supported Python, including callables carrying asyncio's _is_coroutine
marker (AsyncMock from the mock package, asgiref-marked callables),
which inspect.iscoroutinefunction alone rejects. The fake clock awaits
whatever its callback returns.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pytest-asyncio 0.23 calls asyncio.iscoroutinefunction and the event
loop policy functions, producing ~710k warnings per 3.14 job. The
releases that avoid them need Python 3.9 and pytest 8.2, so filter
those three messages from the pytest_asyncio module only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
staging/pull/726/features — 0c6390f2 Deployed Oct 1, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant