Skip to content

Commit c2a365c

Browse files
committed
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.
1 parent 05076de commit c2a365c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ func TestEnsureAdminClusterRoleBindingImpl(t *testing.T) {
933933
}
934934

935935
client, err := EnsureAdminClusterRoleBindingImpl(
936-
context.Background(), adminClient, superAdminClient, time.Millisecond*50, time.Millisecond*1000)
936+
context.Background(), adminClient, superAdminClient, 0, 0)
937937
if (err != nil) != tc.expectedError {
938938
t.Fatalf("expected error: %v, got %v, error: %v", tc.expectedError, err != nil, err)
939939
}

0 commit comments

Comments
 (0)