s4 messaging tests: Fix race condition in smbcontrol tests
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 20 Dec 2018 02:46:21 +0000 (15:46 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 21 Dec 2018 02:39:24 +0000 (03:39 +0100)
The test for the smbcontrol sleep command and the inject fault command
both used the "rpc_server" process as a target.  As the inject fault
command caused the process to restart there was a race condition between
the process restarting and the sleep test running.  To prevent this the
tests now use different target processes.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Dec 21 03:39:24 CET 2018 on sn-devel-144

python/samba/tests/blackbox/smbcontrol_process.py

index 4313c6faef3278a1a3dd096c2f981c67fddad1b7..b4ccc4c455c0f260b78dc872765049b3f4424a76 100644 (file)
@@ -54,6 +54,10 @@ class SmbcontrolProcessBlockboxTests(BlackboxTestCase):
     def test_inject_fault(self):
         INJECT = "inject"
         FAULT = "segv"
+        #
+        # Note that this process name needs to be different to the one used
+        # in the sleep test to avoid a race condition
+        #
         pid = self.get_process("rpc_server")
 
         #
@@ -90,7 +94,11 @@ class SmbcontrolProcessBlockboxTests(BlackboxTestCase):
         DURATION = 5     # duration to sleep server for
         DELTA = 1        # permitted error for the sleep duration
 
-        pid = self.get_process("rpc_server")
+        #
+        # Note that this process name needs to be different to the one used
+        # in the inject fault test to avoid a race condition
+        #
+        pid = self.get_process("ldap_server")
         #
         # Ensure we can ping the process before getting it to sleep
         #