From: Tim Beale Date: Sun, 17 Jun 2018 21:52:57 +0000 (+1200) Subject: tests: Increase PSO test timeouts to minimise failures X-Git-Tag: tevent-0.9.37~260 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3bf30e3a7852e4e0ced9e347363c71b799752f0;p=thirdparty%2Fsamba.git tests: Increase PSO test timeouts to minimise failures When PSOs exist in the DB, there is some extra overhead involved in user logins (an extra expand-nested-groups operation for every user login). Currently password_lockout tests are quite query-intensive - each call to _check_account() does ~6 RPC operations/LDB searches (plus sleeps for 20 millisecs). Plus the actual user login attempt being tested. It looks like the current test needs to do 3 login attempts/_check_account() calls within a 2-second window. While the PSO test cases usually work OK, sometimes they fail (presumably they take slightly longer and fall outside this 2-second window). Presumably this is due to the cloud instance's CPU being slightly more loaded when the test is run. Long-term the plan is to refactor the user login so that the extra expand-nested-groups operation is unnecessary for PSOs. In the short-term, increase the window the test uses from 2 seconds to 3 seconds. Signed-off-by: Tim Beale Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/tests/python/password_lockout.py b/source4/dsdb/tests/python/password_lockout.py index 26decf6a54f..ec6cf13fe66 100755 --- a/source4/dsdb/tests/python/password_lockout.py +++ b/source4/dsdb/tests/python/password_lockout.py @@ -618,9 +618,13 @@ userPassword: thatsAcomplPASS2XYZ def use_pso_lockout_settings(self, creds): # create a PSO with the lockout settings the test cases normally expect pso = PasswordSettings("lockout-PSO", self.ldb, lockout_attempts=3, - lockout_duration=2) + lockout_duration=3) self.addCleanup(self.ldb.delete, pso.dn) + # the test cases should sleep() for the PSO's lockoutDuration/obsvWindow + self.account_lockout_duration = 3 + self.lockout_observation_window = 3 + userdn = "cn=%s,cn=users,%s" % (creds.get_username(), self.base_dn) pso.apply_to(userdn)