summaryrefslogtreecommitdiff
path: root/test/test_client.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2015-03-30 15:28:54 -0700
committerDana Powers <dana.powers@gmail.com>2015-03-30 15:28:54 -0700
commit6fc6856746c9e27d4c96b47b1941b6ebbabcb33b (patch)
tree1a5ae56309fdc6a08965ce984f4e4a313ca83a33 /test/test_client.py
parentd05fccb9ef6a5a52de55b7ed7929bdbe3caed8a4 (diff)
parent1313388662d509ade01f71d0740cd0efe263c01f (diff)
downloadkafka-python-6fc6856746c9e27d4c96b47b1941b6ebbabcb33b.tar.gz
Merge pull request #355 from dpkp/correlation_id_modulo
correlation_id modulo
Diffstat (limited to 'test/test_client.py')
-rw-r--r--test/test_client.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_client.py b/test/test_client.py
index c522d9a..abda421 100644
--- a/test/test_client.py
+++ b/test/test_client.py
@@ -401,3 +401,11 @@ class TestKafkaClient(unittest.TestCase):
with self.assertRaises(ConnectionError):
KafkaConnection("nowhere", 1234, 1.0)
self.assertGreaterEqual(t.interval, 1.0)
+
+ def test_correlation_rollover(self):
+ with patch.object(KafkaClient, 'load_metadata_for_topics'):
+ big_num = 2**31 - 3
+ client = KafkaClient(hosts=[], correlation_id=big_num)
+ self.assertEqual(big_num + 1, client._next_id())
+ self.assertEqual(big_num + 2, client._next_id())
+ self.assertEqual(0, client._next_id())