1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
From: =?utf-8?q?=C3=89tienne_Mollier?= <emollier@debian.org>
Date: Sun, 26 Feb 2023 11:38:48 +0100
Subject: Fix test failure appearing with recent librdkafka
Bug: https://github.com/confluentinc/confluent-kafka-python/pull/1467
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031483
---
tests/test_Producer.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/test_Producer.py b/tests/test_Producer.py
index ef82b41..41eac1f 100644
--- a/tests/test_Producer.py
+++ b/tests/test_Producer.py
@@ -206,8 +206,8 @@ def test_transaction_api():
# Any subsequent APIs will fail since init did not succeed.
with pytest.raises(KafkaException) as ex:
p.begin_transaction()
- assert ex.value.args[0].code() == KafkaError._STATE
- assert ex.value.args[0].retriable() is False
+ assert ex.value.args[0].code() == KafkaError._CONFLICT
+ assert ex.value.args[0].retriable() is True
assert ex.value.args[0].fatal() is False
assert ex.value.args[0].txn_requires_abort() is False
@@ -218,22 +218,22 @@ def test_transaction_api():
with pytest.raises(KafkaException) as ex:
p.send_offsets_to_transaction([TopicPartition("topic", 0, 123)],
group_metadata)
- assert ex.value.args[0].code() == KafkaError._STATE
- assert ex.value.args[0].retriable() is False
+ assert ex.value.args[0].code() == KafkaError._CONFLICT
+ assert ex.value.args[0].retriable() is True
assert ex.value.args[0].fatal() is False
assert ex.value.args[0].txn_requires_abort() is False
with pytest.raises(KafkaException) as ex:
p.commit_transaction(0.5)
- assert ex.value.args[0].code() == KafkaError._STATE
- assert ex.value.args[0].retriable() is False
+ assert ex.value.args[0].code() == KafkaError._CONFLICT
+ assert ex.value.args[0].retriable() is True
assert ex.value.args[0].fatal() is False
assert ex.value.args[0].txn_requires_abort() is False
with pytest.raises(KafkaException) as ex:
p.abort_transaction(0.5)
- assert ex.value.args[0].code() == KafkaError._STATE
- assert ex.value.args[0].retriable() is False
+ assert ex.value.args[0].code() == KafkaError._CONFLICT
+ assert ex.value.args[0].retriable() is True
assert ex.value.args[0].fatal() is False
assert ex.value.args[0].txn_requires_abort() is False
|