From c9bbb411ae06dbed6f6f695c741adacf757c6551 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Fri, 12 Apr 2019 09:19:37 +0000
Subject: [PATCH] SW-610: fixed messagebus test which failed if ran in parallel
 in multiple builds-with-tests. The problem was a too largs messagebody
 filling the broker queue. Reduced the bodies size to 2^16+1.

---
 LCS/Messaging/python/messaging/test/t_messagebus.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/LCS/Messaging/python/messaging/test/t_messagebus.py b/LCS/Messaging/python/messaging/test/t_messagebus.py
index 9fd36ba7db3..352dbb49593 100644
--- a/LCS/Messaging/python/messaging/test/t_messagebus.py
+++ b/LCS/Messaging/python/messaging/test/t_messagebus.py
@@ -468,7 +468,9 @@ class SendReceiveMessage(unittest.TestCase):
         """
         Test send/receive of an RequestMessage, containing a large string
         """
-        content = 100000*'abcdefghijklmnopqrstuvwxyz' #large enough string, but not too big to overload the broker buffers
+        content = ((2**16)+1)*'a' # test if the messages can handle a string with more than 2^16 chars which is aparently a probly for some brokers of messaging libs.
+                                  # so, we need a large enough string, but not too big to overload the broker buffers when running multiple tests at the same time
+
         self._test_sendrecv(RequestMessage(content, reply_to=self.test_queue.address))
 
     def test_sendrecv_request_message_with_nested_dicts_and_lists_with_special_types(self):
@@ -483,7 +485,8 @@ class SendReceiveMessage(unittest.TestCase):
                             {'a': 'b',
                              'c': { 'timestamp': round_to_millisecond_precision(datetime.utcnow())}}],
                    'bar': [],
-                   'large_string': 100000*'abcdefghijklmnopqrstuvwxyz' #large enough string, but not too big to overload the broker buffers
+                   'large_string': ((2**16)+1)*'a' # test if the messages can handle a string with more than 2^16 chars which is aparently a probly for some brokers of messaging libs.
+                                                   # so, we need a large enough string, but not too big to overload the broker buffers when running multiple tests at the same time
                    }
         self._test_sendrecv(RequestMessage(content, reply_to=self.test_queue.address))
 
-- 
GitLab