Skip to content

Commit b520c8d

Browse files
committed
Adjust consumer test error codes and timeouts
1 parent e9c9570 commit b520c8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_Consumer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def dummy_commit_cb (consumer, err, partitions):
1616
pass
1717

1818
kc = Consumer({'group.id':'test', 'socket.timeout.ms':'100',
19+
'session.timeout.ms': 1000, # Avoid close() blocking too long
1920
'on_commit': dummy_commit_cb})
2021

2122
kc.subscribe(["test"])
@@ -45,7 +46,7 @@ def dummy_assign_revoke (consumer, partitions):
4546
try:
4647
kc.commit(async=False)
4748
except KafkaException as e:
48-
assert e.args[0].code() in (KafkaError._TIMED_OUT, KafkaError._WAIT_COORD)
49+
assert e.args[0].code() in (KafkaError._TIMED_OUT, KafkaError._NO_OFFSET)
4950

5051
# Get current position, should all be invalid.
5152
kc.position(partitions)

0 commit comments

Comments
 (0)