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
 
