Blame SOURCES/fix-qdevice-tests-failing-due-to-multithreading.patch

15f218
From c178935290a5387fdfbd54330769ee159d8916b6 Mon Sep 17 00:00:00 2001
15f218
From: Tomas Jelinek <tojeline@redhat.com>
15f218
Date: Fri, 1 Jul 2016 10:39:48 +0200
15f218
Subject: [PATCH] test: fix qdevice tests failing due to multithreading
15f218
15f218
---
15f218
 pcs/test/test_lib_commands_quorum.py | 37 ++++++++++++++++++++++--------------
15f218
 1 file changed, 23 insertions(+), 14 deletions(-)
15f218
15f218
diff --git a/pcs/test/test_lib_commands_quorum.py b/pcs/test/test_lib_commands_quorum.py
15f218
index c12ab66..826251a 100644
15f218
--- a/pcs/test/test_lib_commands_quorum.py
15f218
+++ b/pcs/test/test_lib_commands_quorum.py
15f218
@@ -763,7 +763,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
         mock_get_cert_request.assert_called_once_with(
15f218
             "mock_runner",
15f218
             self.cluster_name
15f218
@@ -786,7 +786,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_import_calls),
15f218
             len(mock_import_cert.mock_calls)
15f218
         )
15f218
-        mock_import_cert.assert_has_calls(client_import_calls)
15f218
+        mock_import_cert.assert_has_calls(client_import_calls, any_order=True)
15f218
 
15f218
     def test_error_get_ca_cert(
15f218
         self, mock_get_ca, mock_client_setup, mock_get_cert_request,
15f218
@@ -894,7 +894,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
 
15f218
     def test_error_client_setup_skip_offline(
15f218
         self, mock_get_ca, mock_client_setup, mock_get_cert_request,
15f218
@@ -959,7 +959,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
 
15f218
     def test_generate_cert_request_error(
15f218
         self, mock_get_ca, mock_client_setup, mock_get_cert_request,
15f218
@@ -1004,7 +1004,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
         mock_get_cert_request.assert_called_once_with(
15f218
             "mock_runner",
15f218
             self.cluster_name
15f218
@@ -1062,7 +1062,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
         mock_get_cert_request.assert_called_once_with(
15f218
             "mock_runner",
15f218
             self.cluster_name
15f218
@@ -1119,7 +1119,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
         mock_get_cert_request.assert_called_once_with(
15f218
             "mock_runner",
15f218
             self.cluster_name
15f218
@@ -1201,7 +1201,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
         mock_get_cert_request.assert_called_once_with(
15f218
             "mock_runner",
15f218
             self.cluster_name
15f218
@@ -1224,7 +1224,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_import_calls),
15f218
             len(mock_import_cert.mock_calls)
15f218
         )
15f218
-        mock_import_cert.assert_has_calls(client_import_calls)
15f218
+        mock_import_cert.assert_has_calls(client_import_calls, any_order=True)
15f218
 
15f218
     def test_client_import_cert_error_skip_offline(
15f218
         self, mock_get_ca, mock_client_setup, mock_get_cert_request,
15f218
@@ -1282,7 +1282,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_setup_calls),
15f218
             len(mock_client_setup.mock_calls)
15f218
         )
15f218
-        mock_client_setup.assert_has_calls(client_setup_calls)
15f218
+        mock_client_setup.assert_has_calls(client_setup_calls, any_order=True)
15f218
         mock_get_cert_request.assert_called_once_with(
15f218
             "mock_runner",
15f218
             self.cluster_name
15f218
@@ -1305,7 +1305,7 @@ class AddDeviceNetTest(TestCase):
15f218
             len(client_import_calls),
15f218
             len(mock_import_cert.mock_calls)
15f218
         )
15f218
-        mock_import_cert.assert_has_calls(client_import_calls)
15f218
+        mock_import_cert.assert_has_calls(client_import_calls, any_order=True)
15f218
 
15f218
 
15f218
 @mock.patch.object(LibraryEnvironment, "push_corosync_conf")
15f218
@@ -1507,7 +1507,10 @@ class RemoveDeviceNetTest(TestCase):
15f218
             len(client_destroy_calls),
15f218
             len(mock_client_destroy.mock_calls)
15f218
         )
15f218
-        mock_client_destroy.assert_has_calls(client_destroy_calls)
15f218
+        mock_client_destroy.assert_has_calls(
15f218
+            client_destroy_calls,
15f218
+            any_order=True
15f218
+        )
15f218
 
15f218
     def test_error_client_destroy(self, mock_client_destroy):
15f218
         def raiser(communicator, node):
15f218
@@ -1561,7 +1564,10 @@ class RemoveDeviceNetTest(TestCase):
15f218
             len(client_destroy_calls),
15f218
             len(mock_client_destroy.mock_calls)
15f218
         )
15f218
-        mock_client_destroy.assert_has_calls(client_destroy_calls)
15f218
+        mock_client_destroy.assert_has_calls(
15f218
+            client_destroy_calls,
15f218
+            any_order=True
15f218
+        )
15f218
 
15f218
     def test_error_client_destroy_skip_offline(self, mock_client_destroy):
15f218
         def raiser(communicator, node):
15f218
@@ -1606,7 +1612,10 @@ class RemoveDeviceNetTest(TestCase):
15f218
             len(client_destroy_calls),
15f218
             len(mock_client_destroy.mock_calls)
15f218
         )
15f218
-        mock_client_destroy.assert_has_calls(client_destroy_calls)
15f218
+        mock_client_destroy.assert_has_calls(
15f218
+            client_destroy_calls,
15f218
+            any_order=True
15f218
+        )
15f218
 
15f218
 
15f218
 @mock.patch.object(LibraryEnvironment, "push_corosync_conf")
15f218
-- 
15f218
1.8.3.1
15f218