This is an automated email from the ASF dual-hosted git repository.

duhengforever pushed a commit to branch ctypes
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-python.git


The following commit(s) were added to refs/heads/ctypes by this push:
     new 78a41c8  test(producer) improve the transaction unit test stability
     new 96ca920  Merge pull request #67 from duhenglucky/fix_ci
78a41c8 is described below

commit 78a41c8d5595036bb4db67614867303d14cbe565
Author: duhenglucky <[email protected]>
AuthorDate: Mon Nov 4 16:36:12 2019 +0800

    test(producer) improve the transaction unit test stability
---
 tests/test_producer.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tests/test_producer.py b/tests/test_producer.py
index 2921156..f7b7acf 100644
--- a/tests/test_producer.py
+++ b/tests/test_producer.py
@@ -101,15 +101,14 @@ def test_producer_send_orderly(producer):
 
 def test_transaction_producer():
     stop_event = threading.Event()
-    msgId = None
+    msg_body = 'XXXX'
 
     def on_local_execute(msg, user_args):
-        msgId = msg.id.decode('utf-8')
         return TransactionStatus.UNKNOWN
 
     def on_check(msg):
         stop_event.set()
-        assert msg.id.decode('utf-8') == msgId
+        assert msg.body.decode('utf-8') == msg_body
         return TransactionStatus.COMMIT
 
     producer = TransactionMQProducer('transactionTestGroup' + str(PY_VERSION), 
on_check)
@@ -118,7 +117,7 @@ def test_transaction_producer():
     msg = Message('test')
     msg.set_keys('transaction')
     msg.set_tags('XXX')
-    msg.set_body('XXXX')
+    msg.set_body(msg_body)
     producer.send_message_in_transaction(msg, on_local_execute)
     while not stop_event.is_set():
         time.sleep(2)

Reply via email to