From e1797a5151f8b19fcdc545b85302aaa3c1ba609e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20G=C3=B6ransson?= Date: Fri, 10 Nov 2023 14:55:50 +0100 Subject: [PATCH] service bus client unquote bug do not unquote endpoint arguments when making subscription name unique, otherwise the value will be incorrect when it comes to async-messaged. --- grizzly/tasks/clients/servicebus.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/grizzly/tasks/clients/servicebus.py b/grizzly/tasks/clients/servicebus.py index e5bec498..a48dd325 100644 --- a/grizzly/tasks/clients/servicebus.py +++ b/grizzly/tasks/clients/servicebus.py @@ -193,12 +193,18 @@ def get_state(self, parent: 'GrizzlyScenario') -> State: if state is None: context = self.context.copy() # add id of user as suffix to subscription name, to make it unique - endpoint_arguments = parse_arguments(context['endpoint'], separator=':') + endpoint_arguments = parse_arguments(context['endpoint'], separator=':', unquote=False) if 'subscription' in endpoint_arguments: - endpoint_arguments['subscription'] = f'{endpoint_arguments["subscription"]}_{id(parent.user)}' + subscription = endpoint_arguments['subscription'] + quote = '' + if subscription[0] in ['"', "'"] and subscription[-1] == subscription[0]: + quote = subscription[0] + subscription = subscription[1:-1] + endpoint_arguments['subscription'] = f'{quote}{subscription}_{id(parent.user)}{quote}' context['endpoint'] = ', '.join([f'{key}:{value}' for key, value in endpoint_arguments.items()]) + state = State( parent=parent, client=cast(zmq.Socket, self._zmq_context.socket(zmq.REQ)),