You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* AuthenticatorTest Stability
Several changes that appear to improve the stability of the overall test.
First, broke testSetCurrentUserWithRequest into five uniquely named tests.
One of these is used to verify a user with an expired account cannot log
in. Fix here is to explicitly set the expiration time in the past to
prevent the implementation from validating in the same millisecond.
Second, updated the internal runnable in testSetCurrentUser to generate a
more complex password. Found that the previous password would
occasionally fail the FileBasedAuthenticator password strength check. I
assumed it was because the strength value was being calculated as either 8
or 16. Stregth would evaluate to 8 if the 8-character string was composed
of only one unique type of character (upper/lower/number/special), 16 if
there were only 2 unique types. By setting the string length to 17 we
explicitly avoid this potential failure in testing.
Third, I had implemented a section of code in the tear-down behavior that
cleared the userDB file and used Whitebox to null the 'userDB' attribute
in the FileBasedAuthenticator instance. Even with that I was still seeing
issues in testSetCurrentUser where the test would fail because the user
account would already exist. To account for this, I modified all user
names to be randomly generated Strings which will avoid the test
unintentionally creating more than user by the same name.
Finally, in testGetCurrentUser there was a value being tracked for the
user compare 'result'. Though part of the tests' validation, it would not
have failed the test since it was being checked within the Runnable
context and not being propagated back to the test execution scope. I
modified the implementation to add the boolean 'result' check to the
ErrorCollector, which can fail the test if a mismatched user reference
occurs.
With these changes I can run this test in isolation 100/100 times
successfully.
* Authenticatortest Stability
In addition to issues resolved in previous commit, an additional
intermittent problem was identified having to do with file IO during
testing. To account for the IO timing, the timeout of the implementation
was extended from 10 seconds to 5 minutes. The timeout was originally
applied to prevent the test from running indefinitely, without
consideration for any performance requirements. The timeout extension
still fulfills the original intent and accounts for issues we're currently
experiencing.
@kwwall confirmed that it works on Linux as well (where it had been timeout out with a 10 second timeout). Passed 100 out of 100 times there as well.
Close issue #360
0 commit comments