Skip to content

Setup CI for adapter with service dependencies - #8

Open
timkpaine wants to merge 2 commits into
mainfrom
tkp/adapters
Open

Setup CI for adapter with service dependencies#8
timkpaine wants to merge 2 commits into
mainfrom
tkp/adapters

Conversation

@timkpaine

Copy link
Copy Markdown
Member

No description provided.

@timkpaine
timkpaine force-pushed the tkp/adapters branch 3 times, most recently from 7b48be6 to 0f91511 Compare February 4, 2024 13:29
@timkpaine timkpaine added the tag: internal Issues and PRs for maintainance of the project - not interesting to external users label Feb 6, 2024
@timkpaine
timkpaine force-pushed the tkp/adapters branch 7 times, most recently from 93e5d1b to 8693a5a Compare February 19, 2024 17:01
@timkpaine
timkpaine force-pushed the tkp/adapters branch 2 times, most recently from 87d1023 to 95b9a53 Compare February 28, 2024 14:57
@timkpaine timkpaine closed this Mar 13, 2024
@timkpaine
timkpaine deleted the tkp/adapters branch March 13, 2024 23:17
@timkpaine
timkpaine restored the tkp/adapters branch May 3, 2024 14:01
@timkpaine timkpaine reopened this May 3, 2024
@timkpaine
timkpaine force-pushed the tkp/adapters branch 2 times, most recently from 08995d1 to 7a07db5 Compare May 24, 2024 08:30
@timkpaine
timkpaine marked this pull request as ready for review June 30, 2024 03:29
@timkpaine timkpaine added the adapter: kafka Issues and PRs related to the Apache Kafka adapter label Jun 30, 2024
@timkpaine

Copy link
Copy Markdown
Member Author

@robambalu

Copy link
Copy Markdown
Collaborator

https://github.com/Point72/csp/actions/runs/10149403062/job/28067369034

Based on the test and the error message it looks like whats happening is that the sub is missing the first pub. Its possible the daemon is late to register the subscriber before the first publish. One way to try and fix it is to delay the first pub a bit. Another possibility is to compare the last N msgs rather than the first N

@timkpaine
timkpaine force-pushed the tkp/adapters branch 2 times, most recently from fc66f1e to 8bca913 Compare September 2, 2024 00:04
@timkpaine
timkpaine force-pushed the tkp/adapters branch 2 times, most recently from c64cb93 to 21229ed Compare September 10, 2024 14:11
@timkpaine
timkpaine marked this pull request as draft March 1, 2025 00:33
@timkpaine
timkpaine force-pushed the tkp/adapters branch 6 times, most recently from a7aadad to 520c30a Compare March 2, 2025 22:54
Comment thread csp/tests/adapters/test_kafka.py Outdated
@ptomecek ptomecek mentioned this pull request Nov 28, 2025
@ptomecek

Copy link
Copy Markdown
Collaborator

@timkpaine Resolving conflicts looks straightforward, and so assuming the tests still pass, can we take this PR out of draft mode?

@timkpaine
timkpaine force-pushed the tkp/adapters branch 2 times, most recently from 83a3f7a to 85c9eb5 Compare February 14, 2026 23:35
@timkpaine
timkpaine marked this pull request as ready for review February 18, 2026 03:29
@timkpaine
timkpaine requested review from ptomecek and removed request for czgdp1807 February 18, 2026 03:29
@timkpaine
timkpaine requested a review from arhamchopra as a code owner August 13, 2026 21:35
@timkpaine
timkpaine force-pushed the tkp/adapters branch 2 times, most recently from 5f6236a to a74fea0 Compare August 13, 2026 23:12
Run the Kafka adapter integration tests in CI against a real broker. Adds a test_adapters job
that stands up ci/kafka/docker-compose.yml, sets CSP_TEST_<ADAPTER>, and runs the matching
tests, plus dockerup/dockerps/dockerdown targets for doing the same locally.

The compose stack is trimmed to zookeeper and a single broker, with healthchecks so
`docker compose up --wait` blocks until the broker accepts connections rather than relying on a
fixed sleep. Only 9092 is published, bound to loopback. Broker-side topic auto-creation is
disabled so test_invalid_topic can exercise the failure path, and tests create their topics
explicitly through the Kafka AdminClient.

Test changes target the startup race where a subscriber misses the first few records while its
consumer group is being assigned. Rather than loosening the assertions, the affected tests align
on the first record the subscriber saw and then require an exact contiguous run, so loss,
duplication and reordering are still caught.

Also drops curl from the Windows chocolatey install: the package fails whenever a new version is
approved on the community feed before it is downloadable, and curl.exe ships with Windows.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
The tests bootstrapped from "localhost", which also resolves to ::1 where
the container publishes nothing, so librdkafka failed whichever address it
picked next. Point them at 127.0.0.1, matching the published port and the
advertised listener.

A single all-brokers-down report then killed the engine, though librdkafka
reports it on every failed connection round and reconnects on its own.
Escalation now waits for the brokers to stay down for broker_down_tolerance,
checked on the poll threads rather than on the report, since librdkafka may
not report again for seconds. Shutdown no longer waits on a flush that
cannot complete.

A topic that the broker will not auto-create left a subscriber looking idle
forever. The consumer reports that through poll rather than the event
callback, so escalate it there, and on the publisher through the delivery
report.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adapter: kafka Issues and PRs related to the Apache Kafka adapter tag: internal Issues and PRs for maintainance of the project - not interesting to external users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants