mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 23:03:40 +00:00
kubeadm: do not poll in TestEnsureAdminClusterRoleBindingImpl
In EnsureAdminClusterRoleBindingImpl() there are a couple of polls around CRB create calls. When testing the function a short retry and a timeout are used. These introduce around 2x20 fake client "connections" / poll iterations under a couple of test cases with 2 seconds overall test increase. Given the polls in EnsureAdminClusterRoleBindingImpl() are of type PollUntilContextTimeout() with "immediate" set to "true", the short retry / time out can be removed when testing, because one poll iteration is guaranteed and the tested function is at 100% coverage with reactors and test cases.
This commit is contained in:
parent
05076de57f
commit
c2a365c6a7
@ -933,7 +933,7 @@ func TestEnsureAdminClusterRoleBindingImpl(t *testing.T) {
|
||||
}
|
||||
|
||||
client, err := EnsureAdminClusterRoleBindingImpl(
|
||||
context.Background(), adminClient, superAdminClient, time.Millisecond*50, time.Millisecond*1000)
|
||||
context.Background(), adminClient, superAdminClient, 0, 0)
|
||||
if (err != nil) != tc.expectedError {
|
||||
t.Fatalf("expected error: %v, got %v, error: %v", tc.expectedError, err != nil, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user