-
Notifications
You must be signed in to change notification settings - Fork 3.2k
K2 testing final #5198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
K2 testing final #5198
Conversation
Conflicts: tests/0011-produce_batch.c
…lete.retention.ms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update PR description, since there are large amount of changes. It will help with review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements testing support for K2 (Kafka-compatible) clusters by adding comprehensive configuration options and adapting tests to work with different cluster environments. The changes enable tests to handle varying acks support, idempotent producer requirements, and cloud/managed cluster constraints.
- Added K2 cluster detection and configuration support with timeout adjustments
- Implemented flexible acks value testing and cluster-specific feature detection
- Enhanced test framework with version-aware APIs and graceful degradation for older librdkafka versions
Reviewed Changes
Copilot reviewed 91 out of 91 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
tests/testshared.h | Added function declarations for K2 cluster support, acks validation, and topic creation utilities |
tests/test.h | Added TEST_F_IDEMPOTENT_PRODUCER flag and K2 cluster variable declaration |
tests/test.conf.example | Added configuration options for test skipping, acks support, sleep multipliers, and idempotent producer handling |
tests/test.c | Core implementation of K2 support, acks validation, test skipping logic, and enhanced test framework functions |
Multiple test files | Updated individual tests to use broker-default replication factors, version-aware APIs, and conditional test execution |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 95 out of 95 changed files in this pull request and generated 10 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of review. Left some comments!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for changes!
Few comments for rest of files.
… Removed deprecated `safe_print_partition_list` and replaced its usage with `test_print_partition_list_with_errors` and `test_print_partition_list_no_errors` across multiple test files.
…cy and clarity. Updated all instances of test_sleep to sleep_for across multiple test files, ensuring uniformity in sleep duration handling.
…guration. Updated test files to eliminate conditional logic related to K2 clusters, ensuring consistent fetch limits across all tests.
…y. Adjusted fetch.max.bytes and receive.message.max.bytes settings to improve test reliability. Modified topic creation functions to ensure topics are created with the correct parameters across multiple test cases.
…out-based waits. Updated tests to accommodate cloud environments with higher latencies, ensuring rebalancing operations complete reliably. Expanded error handling in commit callbacks to include additional scenarios that may occur during rebalancing.
…djusting timeout handling for cloud environments. Added checks for partition existence and refined error handling for GROUP resource configurations, ensuring compatibility with managed Kafka services.
This PR refactors the librdkafka test suite to improve cloud compatibility by adding configurable options in
test.conf
. This enables better test portability and maintainability across different Kafka environments.Changes
1. Configurable Test Framework
test.skip.idempotent
: Skip tests requiring idempotent producer (replaces-I
flag)test.supported.acks
: Configure supported acknowledgment values (e.g.,-1,0,1
)test.sleep.multiplier
: Configurable sleep multiplier for different environments. Multiplies explicit sleep_for() delays for cluster state propagation (set 0 to skip sleeps), different from test.timeout.multiplier which multiplies API operation timeouts (can't be disabled).test.timeout.multiplier
: Unified timeout scaling (existing feature, now consistently used)test.skip.numbers
: Skip specific tests by number (comma-separated list)2. Topic Cleanup
3. Replication Factor
-1
)4. Preprocessor Directives for Version Compatibility
🔧 Configuration Examples