Skip to content

Commit 87bea90

Browse files
author
Dana Powers
committed
Encode random_message strings to bytes in test_failover_integration
1 parent 3085faa commit 87bea90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_failover_integration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ def test_switch_leader_keyed_producer(self):
173173
def _send_random_messages(self, producer, topic, partition, n):
174174
for j in range(n):
175175
logging.debug('_send_random_message to %s:%d -- try %d', topic, partition, j)
176-
resp = producer.send_messages(topic, partition, 'msg {0}: {1}'.format(j, random_string(10)))
176+
msg = 'msg {0}: {1}'.format(j, random_string(10))
177+
resp = producer.send_messages(topic, partition, msg.encode('utf-8'))
177178
if len(resp) > 0:
178179
self.assertEqual(resp[0].error, 0)
179180
logging.debug('_send_random_message to %s:%d -- try %d success', topic, partition, j)

0 commit comments

Comments
 (0)