Conversation
ceache
requested review from
StephenSorriaux,
a-ungurianu,
bbangert and
jeffwidman
September 10, 2026 07:12
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #802 +/- ##
==========================================
- Coverage 94.90% 88.76% -6.15%
==========================================
Files 27 30 +3
Lines 3811 4289 +478
==========================================
+ Hits 3617 3807 +190
- Misses 194 482 +288 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ceache
marked this pull request as ready for review
September 10, 2026 07:26
Contributor
Author
|
I will extract the black, python38 and all the bugfixes in separate PRs to try to minimize the diff in this one. But it is inherently a large rewrite of our test harness |
ceache
force-pushed
the
feature/docker-compose-tests
branch
from
September 14, 2026 01:00
8cb597a to
76aca7e
Compare
houndci-bot
reviewed
Sep 14, 2026
ceache
force-pushed
the
feature/docker-compose-tests
branch
8 times, most recently
from
September 14, 2026 06:43
5966b3d to
478fae1
Compare
ceache
marked this pull request as draft
September 14, 2026 07:05
ceache
force-pushed
the
feature/docker-compose-tests
branch
from
September 14, 2026 13:25
478fae1 to
2c276f7
Compare
ceache
marked this pull request as ready for review
September 15, 2026 01:44
ceache
force-pushed
the
feature/docker-compose-tests
branch
7 times, most recently
from
September 19, 2026 02:28
fdbad58 to
dc78c6b
Compare
…tart_async() semantics Addresses python-zk#594 Addresses python-zk#727
…ure kazoo.testing package - Replace legacy ZookeeperCluster process driver with testcontainers 4.x using base+overlay compose layouts (docker-compose.base.yml). - Add auth matrix overlays for digest, sasl-digest, tls, and sasl-gssapi with certgen and alpine KDC sidecars. - Scaffold docker-compose.capture.yml feature overlay and tshark sidecar for pcapng network packet capture, splitting ensemble into netns-holder + service pairs. - Emit TLS keylog files and context certificates from tls-secrets-agent for Wireshark/pcapng TLS decryption. - Restructure kazoo.testing package into kazoo.testing.common (core logic, helpers) and kazoo.testing.fixtures (pytest plugins), retiring harness.py. - Move compose overlays, JAAS configs, and Dockerfile resources into kazoo.testing package using importlib.resources. - Migrate integration tests off KazooTestCase to zkclient/zkensemble pytest fixtures and retire legacy root compose files. - Add registered pytest markers (zk_version, zk_auth, zk_features) with collection-time evaluation and skip reasons. - Introduce ZK axis enums (backports.strenum / enum.StrEnum) and bump default ZK version to 3.9.5. - Add contract & unit tests reaching 93%+ coverage on kazoo.testing pure helpers and subprocess functions. - Optimize GitHub Actions workflows with test matrices, docker layer caching, and Windows WSL2 runner support.
ceache
force-pushed
the
feature/docker-compose-tests
branch
from
September 19, 2026 15:20
dc78c6b to
8533a04
Compare
ceache
enabled auto-merge
September 19, 2026 15:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Review Scope Notice:
This PR is stacked on top of PR #808 (
fix/protocol-defer-connected-until-auth). Because PR #808 has not yet been merged intomaster, this PR includes its commit history.Please only review the last 2 commits:
6913472test(core): split offline unit tests into kazoo/tests/unit8533a04feat(testing): overhaul test harness with docker compose and restructure kazoo.testing packageFixes #821
Why is this needed?
The legacy test harness (
kazoo.testing.harness) relied on local JVM/ZooKeeper binary installations, custom environment setup scripts (ensure-zookeeper-env.sh), and hardcoded port configurations. This created multiple maintenance and developer experience challenges:Proposed Changes
This PR introduces a modular, containerized test harness powered by Docker Compose and pytest fixtures, separates offline unit tests, and hardens client/protocol reliability:
Docker Compose Test Harness (
kazoo.testing):harness.pywith modular packages:kazoo.testing.common(axis resolution, mount handling, ensemble state) andkazoo.testing.fixtures(pytest fixtures).zoo1,zoo2,zoo3).superDigest), SASL Digest (DIGEST-MD5), SASL GSSAPI (with embedded MIT Kerberos KDC sidecar), and mutual TLS (withcertgenandtls-secrets-agentsidecars).tshark) generating.pcapngtraces and TLS keylog material.2181/2281), eliminating static port math and port collisions.zkchroot) shared cleanly acrosszkclientandzksuperadmin_client.docker_envsnapshot and restoration on session teardown.KAZOO_TESTING_ZK_*environment variables (with fallback toZK_*in CLI option parsing).zk_version,zk_auth,zk_features) and CLI options (--zk-version,--zk-auth,--zk-features).Offline Unit Test Separation (
kazoo/tests/unit):pytest kazoo/tests/unitruns 192 tests in ~12 seconds with zero network or Docker dependencies.kazoo/tests/unit/test_testing.pyproviding comprehensive coverage for harness logic and fixtures.Style & Python 3.12+ AST Compatibility:
black==24.10.0and commit registered in.git-blame-ignore-revs.Client & Protocol Bug Fixes:
fix(client): Pass peer hostname instead of port as TLS SNI server name inKazooClient.command().fix(protocol): PropagateConnectionDroppedduring SASL handshake to enable cluster failover retry instead of stopping connection attempts.fix(protocol): DeferCONNECTEDstate notification until SASL and initial auth data dispatch complete, and handleSASLExceptioncleanly.test(client): Eliminate flakiness in request queuing and reconnect tests by awaiting explicit server state and synchronization events.test(integ): Flush replication viaclient1.sync("/1")intest_connect_authto prevent replication lag assertions.test(unit): Usesocket.socketpair()intest_select_mutatedto eliminate macOS pipe deadlock.Does this PR introduce any breaking change?
kazoo.testing.harness.KazooTestCasetest base class is replaced by standard pytest fixtures (zkensemble,zkclient,zksuperadmin_client,zkchroot).KAZOO_TESTING_ZK_*prefix (legacyZK_*variable names remain supported as fallbacks in CLI resolution).