Skip to content

Fix stale, hanging, and unrun ggsql-jupyter protocol tests - #557

Draft
samclark2015 wants to merge 1 commit into
mainfrom
sclark/posit-dev-positron-15512
Draft

samclark2015 wants to merge 1 commit into
mainfrom
sclark/posit-dev-positron-15512

Conversation

@samclark2015

Copy link
Copy Markdown
Contributor

Summary

Fixes posit-dev/positron#15512: the Python protocol tests under ggsql-jupyter/tests/ had been stale and unrun (not wired into CI) since ~January 2026. This PR fixes the suite and wires it into CI.

  • test_compliance.py: fixed a stale implementation string mismatch, a pager assertion that could never pass, and a kernelspec install that could clobber a developer's real ggsql kernelspec (now isolated to a scratch JUPYTER_DATA_DIR under a ggsql-test name). Also fixed two independent hangs — test_shutdown was killing the class-shared kernel before test_status_messages ran (alphabetical test ordering), and test_kernel_info waited forever on a reply it explicitly filters out via get_non_kernel_info_reply — plus a third bug where test_shutdown read its reply from the wrong ZMQ channel (control, not shell). Also collapsed the per-test cargo build in setUp down to once per module.
  • test_integration.py: replaced a blind sleep(3) with a real kernel-readiness check (14/14 tests pass; runtime dropped from ~211s to ~36s). Fixed a bug this exposed in how jupyter_client's is_alive() was being used, given this test launches the kernel process manually rather than through KernelManager.start_kernel().
  • requirements.txt: dropped jupyterlab/ipykernel, unused by either test file.
  • Added a jupyter-protocol-tests job to .github/workflows/build.yaml. It runs with continue-on-error: true for now — see below.
  • Updated ggsql-jupyter/tests/README.md and ggsql-jupyter/CLAUDE.md to match.

A separate, pre-existing bug found along the way

While verifying these fixes, kernel startup intermittently panicked (crashed the whole kernel process) from a bug in the vendored zeromq crate's RepSocket, used for ggsql-jupyter's heartbeat socket — unrelated to anything in this PR. Filed as posit-dev/ggsql#556. It hit ~3 of 4 local runs, so the new CI job has continue-on-error: true until #556 is fixed, to avoid a flaky-red job on every PR.

Test plan

  • test_integration.py: 14/14 passing locally
  • test_compliance.py: passing locally when kernel startup doesn't hit ggsql-jupyter's heartbeat socket can panic the whole kernel (zeromq RepSocket, not yet implemented) #556's panic; confirmed the real ggsql kernelspec is never touched across multiple runs
  • Confirmed via ggsql-jupyter/src/kernel.rs that shutdown_reply is sent on the control channel, matching the test_shutdown fix
  • New jupyter-protocol-tests CI job goes green (or at least runs, given continue-on-error) on this PR

🤖 Generated with Claude Code

test_compliance.py and test_integration.py under ggsql-jupyter/tests/ had
gone unrun and untested since ~January 2026 (posit-dev/positron#15512):
a stale implementation string, a pager assertion that could never pass,
a kernelspec install that could clobber a developer's real "ggsql" kernel,
and two independent hangs (test_shutdown killing the class-shared kernel
before test_status_messages runs alphabetically, and test_kernel_info
waiting forever on a reply it explicitly filters out) meant the suite
never ran to completion. test_shutdown also read its reply from the wrong
ZMQ channel. test_integration.py's kernel_manager fixture used a blind
sleep(3) instead of a real readiness check.

Fixes all of the above, isolates the kernelspec install to a scratch
JUPYTER_DATA_DIR, drops unused test dependencies, and wires both files
into a new CI job. That job runs with continue-on-error for now: kernel
startup intermittently panics on a heartbeat-socket bug in the vendored
zeromq crate (#556), unrelated to this suite, which will
make the job flaky until that's fixed separately.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Python protocol tests for ggsql-jupyter are stale, mostly skipped, and not run in CI

1 participant