Skip to content

Wait for the new topic in the describe_topics integration test - #1069

Merged
mensfeld merged 1 commit into
masterfrom
49765-describe-topics-settled
Oct 24, 2026
Merged

mensfeld merged 1 commit into
masterfrom
49765-describe-topics-settled

Conversation

@coipond-coder

@coipond-coder coipond-coder Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

49765

spec/integrations/admin_describe_topics_spec.rb called describe_topics right after create_topic(...).wait. The new topic can still be missing from the broker's metadata at that point, so the test could fail with unknown_topic_or_part for the topic it just created.

Add a describe_topics_settled helper that retries only while the new topic reports unknown_topic_or_part, for at most 10 s. Any other error, or a topic still unknown after the deadline, still fails the test. Same fix as karafka#582 (the file is identical to that PR's version).

The spec/lib #describe_topics specs are not affected: spec/support/admin_topic_auto_wait.rb already waits for the topic after every create_topic(...).wait. No other spec calls describe_topics after create_topic.

Test-only change: no CHANGELOG entry.

Verification (local, plain docker-compose.yml broker)

  • Topic created 1.5 s late from a thread (proof harness, not committed): base fails with unknown_topic_or_part, head passes.
  • Topic never created: head still fails after the 10 s deadline.
  • 20 runs each: base 20/20 pass, head 20/20 pass (the race did not trigger on an idle broker).
  • RuboCop: no offenses. Unit suite (bundle exec rspec): 743 examples, 0 failures.
  • Not run against docker-compose-ssl.yml; CI's complementary workflows run it there.

Performance impact

none (test-only).

@coipond-coder
coipond-coder Bot marked this pull request as ready for review October 23, 2026 19:42
@mensfeld
mensfeld merged commit 10e0ae8 into master Oct 24, 2026
162 checks passed
@mensfeld
mensfeld deleted the 49765-describe-topics-settled branch October 24, 2026 15:50
mensfeld added a commit that referenced this pull request Oct 28, 2026
… spec RSS noise (#1075)

Ports generic spec fixes from karafka-rdkafka that rdkafka-ruby does not have yet:

- karafka#580: give the `Consumer#lag` spec the same 30 s list offsets wait (`consumer.lag(list, 30_000)`) as its siblings.
- karafka-rdkafka 5db5409: retry the `#poll_nb returns a message if there is one` spec on a 30 s deadline instead of a fixed ~2 s (10 attempts), so a loaded runner does not fail it before the fetch lands. It still stops as soon as a message arrives.
- karafka-rdkafka cc9e2b8/84027a6: stabilize `consumer_memberid_clusterid_leak_spec.rb` against RSS noise on Ruby 4.0. It compacts the heap before each RSS sample and runs 400k calls (a leak would be ~11.4 MB) against a 5 MB ceiling, instead of 200k calls against 2 MB. Locally on Ruby 4.0.7 the leak-free delta was 2,496 KB, which the old 2 MB ceiling would have failed.

Everything else merged recently in karafka-rdkafka is either already here (#566/#567 as #1062, #581 as #1070, #582 as #1069) or a port from this repo. The share consumer (KIP-932) and librdkafka patches stay fork-only.

Testing (local, Ruby 4.0.7, librdkafka 2.16.0):
- Full `spec/lib` suite: 744 examples, 0 failures.
- `consumer_memberid_clusterid_leak_spec.rb` passes.
- `rubocop` is clean on the changed files.

The counterpart karafka-rdkafka branch is sync-from-rdkafka-ruby-2026-10-27.
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