Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1665,9 +1665,15 @@ func TestKubeadmControlPlaneReconciler_scaleDownControlPlane_NoError(t *testing.
g := NewWithT(t)

machines := map[string]*clusterv1.Machine{
"one": machine("one"),
"one": machine("one"),
"two": machine("two"),
"three": machine("three"),
}

fd2 := "b"
machines["one"].Spec.FailureDomain = &fd2
machines["three"].Spec.FailureDomain = &fd2

r := &KubeadmControlPlaneReconciler{
Log: log.Log,
recorder: record.NewFakeRecorder(32),
Expand All @@ -1685,16 +1691,23 @@ func TestKubeadmControlPlaneReconciler_scaleDownControlPlane_NoError(t *testing.
Machines: machines,
}

_, err := r.scaleDownControlPlane(context.Background(), cluster, kcp, machines, machines, controlPlane)
g.Expect(err).ToNot(HaveOccurred())
ml := clusterv1.MachineList{}
ml.Items = []clusterv1.Machine{*machines["two"]}
mll := internal.NewFilterableMachineCollectionFromMachineList(&ml)
_, err := r.scaleDownControlPlane(context.Background(), cluster, kcp, machines, mll, controlPlane)
g.Expect(err).To(HaveOccurred())
}

func machine(name string) *clusterv1.Machine {
fd := "a"
return &clusterv1.Machine{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Name: name,
},
Spec: clusterv1.MachineSpec{
FailureDomain: &fd,
},
}
}

Expand Down
3 changes: 1 addition & 2 deletions test/infrastructure/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ test-e2e: ## Run the end-to-end tests

E2E_CONF_FILE ?= e2e/local-e2e.conf
SKIP_RESOURCE_CLEANUP ?= false
FOCUS ?= Basic
run-e2e:
go test ./e2e -v -ginkgo.v -ginkgo.trace -count=1 -timeout=20m -tags=e2e -e2e.config="$(abspath $(E2E_CONF_FILE))" -skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) -ginkgo.focus='$(FOCUS)'
go test ./e2e -v -ginkgo.v -ginkgo.trace -count=1 -timeout=20m -tags=e2e -e2e.config="$(abspath $(E2E_CONF_FILE))" -skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP)

## --------------------------------------
## Binaries
Expand Down
2 changes: 1 addition & 1 deletion test/infrastructure/docker/e2e/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("Docker", func() {
namespace string
clusterGen = &ClusterGenerator{}
)
SetDefaultEventuallyTimeout(3 * time.Minute)
SetDefaultEventuallyTimeout(10 * time.Minute)
SetDefaultEventuallyPollingInterval(10 * time.Second)

BeforeEach(func() {
Expand Down