Skip to content

Conversation

fangnx
Copy link
Member

@fangnx fangnx commented Sep 17, 2025

What

Add integration tests for transactions:

  • test_commit_transaction: committed messages visible to read_committed.
  • test_abort_transaction_then_retry_commit: abort invisible; retry+commit visible.
  • test_send_offsets_to_transaction: offsets committed correctly via send_offsets_to_transaction.
  • test_commit_multiple_topics_partitions: atomic commit across topics/partitions.

Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA: https://confluentinc.atlassian.net/browse/NONJAVACLI-3991

Test & Review

Open questions / Follow-ups

@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@fangnx fangnx marked this pull request as ready for review September 17, 2025 20:36
@fangnx fangnx requested review from MSeal and a team as code owners September 17, 2025 20:36
@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent
Copy link

Failed

  • 67.50% Coverage on New Code (is less than 80.00%)

Analysis Details

25 Issues

  • Bug 2 Bugs
  • Vulnerability 1 Vulnerability
  • Code Smell 22 Code Smells

Coverage and Duplications

  • Coverage 67.50% Coverage (66.10% Estimated after merge)
  • Duplications No duplication information (5.10% Estimated after merge)

Project ID: confluent-kafka-python

View in SonarQube

Copy link
Member

@k-raina k-raina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we should have seperate folders/test_file for performance and integration/e2e tests?

I see currently test_transaction does e2e testing, as there are no performance bounds defined

@@ -34,7 +38,7 @@ def get_test_info(test_type):
def main():
"""Run the ducktape test based on specified type"""
parser = argparse.ArgumentParser(description="Confluent Kafka Python - Ducktape Test Runner")
parser.add_argument('test_type', choices=['producer', 'consumer', 'producer_sr'],
parser.add_argument('test_type', choices=['producer', 'consumer', 'producer_sr', 'transactions'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be possible to run specific tests if we use "producer" string parameters . Eg.
ducktape tests/ducktape/test_producer.py::SimpleProducerTest.test_basic_produce

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I extracted the transaction tests into a standalone file as I think those involve both producer + consumer

from confluent_kafka.aio import AIOConsumer


class TransactionsTest(Test):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need overall design on how to perf test transaction. One of options can be : Run n number of transaction end to end for async vs sync and compare performance

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - I was mostly doing integration tests to verify behavior, but maybe we should benchmark test transactions as well. Let me think about this

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.

2 participants