Merge "Fix Producer shard range ignoring the last shard" into stable/wallaby

This commit is contained in:
Zuul 2023-12-05 19:33:13 +00:00 committed by Gerrit Code Review
commit 66498722dd
2 changed files with 17 additions and 4 deletions

View File

@ -79,7 +79,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()

View File

@ -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)