From 390871602d244510c941f3c978d2f4371bb62bb7 Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Thu, 20 Dec 2018 15:46:21 +1300 Subject: [PATCH] s4 messaging tests: Fix race condition in smbcontrol tests 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 Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri Dec 21 03:39:24 CET 2018 on sn-devel-144 --- python/samba/tests/blackbox/smbcontrol_process.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/samba/tests/blackbox/smbcontrol_process.py b/python/samba/tests/blackbox/smbcontrol_process.py index 4313c6faef3..b4ccc4c455c 100644 --- a/python/samba/tests/blackbox/smbcontrol_process.py +++ b/python/samba/tests/blackbox/smbcontrol_process.py @@ -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 #