diff --git a/designate/producer/service.py b/designate/producer/service.py index bed10c15d..710be53e7 100644 --- a/designate/producer/service.py +++ b/designate/producer/service.py @@ -64,7 +64,7 @@ class Service(service.RPCService): self._partitioner = coordination.Partitioner( self.coordination.coordinator, self.service_name, - self.coordination.coordination_id.encode(), range(0, 4095) + self.coordination.coordination_id.encode(), range(0, 4096) ) self._partitioner.start() diff --git a/designate/tests/test_producer/test_service.py b/designate/tests/test_producer/test_service.py index 18c052b1f..cf2c18d96 100644 --- a/designate/tests/test_producer/test_service.py +++ b/designate/tests/test_producer/test_service.py @@ -15,13 +15,26 @@ # under the License. from oslo_log import log as logging +from designate import objects from designate.tests import TestCase + LOG = logging.getLogger(__name__) class ProducerServiceTest(TestCase): + def setUp(self): + super().setUp() + self.producer_service = self.start_service('producer') + def test_stop(self): - # Test stopping the service - service = self.start_service("producer") - service.stop() + self.producer_service.stop() + + def test_validate_partition_range(self): + self.producer_service.start() + + min_partition = objects.Zone.fields['shard'].min + max_partition = objects.Zone.fields['shard'].max + + self.assertIn(min_partition, self.producer_service.partition_range) + self.assertIn(max_partition, self.producer_service.partition_range)