mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-20 15:04:34 +00:00
Merge branch 'main' into jtc/merge-main-at-d7849c79-to-github
This commit is contained in:
@@ -139,9 +139,9 @@ func LockADTestUser(t *testing.T, env *TestEnv, testUserName string) {
|
||||
// our password policy allows 20 wrong attempts before locking the account, so do 21.
|
||||
// these wrong password attempts could go to different domain controllers, but account
|
||||
// lockout changes are urgently replicated, meaning that the domain controllers will be
|
||||
// synced asap rather than in the usual 15 second interval.
|
||||
// synced asap rather than in the usual 15-second interval.
|
||||
// See https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc961787(v=technet.10)#urgent-replication-of-account-lockout-changes
|
||||
for i := 0; i <= 21; i++ {
|
||||
for i := range 22 {
|
||||
err := conn.Bind(userDN, "not-the-right-password-"+fmt.Sprint(i))
|
||||
require.Error(t, err) // this should be an error
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2021-2023 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2021-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package testlib
|
||||
@@ -87,7 +87,7 @@ func RequireEventually(
|
||||
)
|
||||
|
||||
// Run the check until it completes with no assertion failures.
|
||||
waitErr := wait.PollUntilContextTimeout(context.Background(), tick, waitFor, true, func(ctx context.Context) (bool, error) {
|
||||
waitErr := wait.PollUntilContextTimeout(context.Background(), tick, waitFor, true, func(_ context.Context) (bool, error) {
|
||||
t.Helper()
|
||||
attempts++
|
||||
|
||||
@@ -134,7 +134,7 @@ func RequireEventuallyWithoutError(
|
||||
t.Helper()
|
||||
// This previously used wait.PollImmediate (now deprecated), which did not take a ctx arg in the func.
|
||||
// Hide this detail from the callers for now to keep the old signature.
|
||||
fWithCtx := func(ctx context.Context) (bool, error) { return f() }
|
||||
fWithCtx := func(_ context.Context) (bool, error) { return f() }
|
||||
require.NoError(t, wait.PollUntilContextTimeout(context.Background(), tick, waitFor, true, fWithCtx), msgAndArgs...)
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ func RequireNeverWithoutError(
|
||||
t.Helper()
|
||||
// This previously used wait.PollImmediate (now deprecated), which did not take a ctx arg in the func.
|
||||
// Hide this detail from the callers for now to keep the old signature.
|
||||
fWithCtx := func(ctx context.Context) (bool, error) { return f() }
|
||||
fWithCtx := func(_ context.Context) (bool, error) { return f() }
|
||||
err := wait.PollUntilContextTimeout(context.Background(), tick, waitFor, true, fWithCtx)
|
||||
if err != nil && !wait.Interrupted(err) {
|
||||
require.NoError(t, err, msgAndArgs...) // this will fail and throw the right error message
|
||||
|
||||
Reference in New Issue
Block a user