Skip to content

Commit 1d27bb4

Browse files
authored
Improve e2e tests (#133)
* e2e: add low number of file descriptors helper tip Signed-off-by: Luis Rascao <luis.rascao@gmail.com> * controplane: don't fail status update when no machines available/ready Failing prevents requeing leading to high bootstrap times of the controlplane, in most cases the machine is ready and with IP addresses but the controller is waiting for a full sync. Signed-off-by: Luis Rascao <luis.rascao@gmail.com> --------- Signed-off-by: Luis Rascao <luis.rascao@gmail.com>
1 parent 90e5619 commit 1d27bb4

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ SKIP_CLEANUP ?= false
360360
SKIP_CREATE_MGMT_CLUSTER ?= false
361361

362362
.PHONY: test-e2e-run
363-
test-e2e-run: $(GINKGO) $(KUSTOMIZE) e2e-image ## Run the end-to-end tests
363+
test-e2e-run: $(GINKGO) $(KUSTOMIZE) e2e-image inotify-check ## Run the end-to-end tests
364364
CAPI_KUSTOMIZE_PATH="$(KUSTOMIZE)" time $(GINKGO) -v --trace -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) -poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) \
365365
--tags=e2e --focus="$(GINKGO_FOCUS)" -skip="$(GINKGO_SKIP)" --nodes=$(GINKGO_NODES) --no-color=$(GINKGO_NOCOLOR) \
366366
--timeout=$(GINKGO_TIMEOUT) --output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" $(GINKGO_ARGS) ./test/e2e -- \
@@ -373,6 +373,17 @@ test-e2e-run: $(GINKGO) $(KUSTOMIZE) e2e-image ## Run the end-to-end tests
373373
test-e2e: ## Run the end-to-end tests
374374
$(MAKE) test-e2e-run
375375

376+
# https://cluster-api.sigs.k8s.io/user/troubleshooting.html#cluster-api-with-docker----too-many-open-files
377+
# https://www.suse.com/support/kb/doc/?id=000020048
378+
.PHONY: inotify-check
379+
inotify-check:
380+
@if [ `cat /proc/sys/fs/inotify/max_user_instances` -le 256 ]; then \
381+
echo -e "\033[0;31mfs.inotify.max_user_instances is too low, test may fail (sudo sysctl fs.inotify.max_user_instances=8192)\033[0m";\
382+
fi
383+
@if [ `cat /proc/sys/fs/inotify/max_user_watches` -le 8192 ]; then \
384+
echo -e "\033[0;31mfs.inotify.max_user_watches is too low, tests may fail (sudo sysctl fs.inotify.max_user_watches=1048576)\033[0m"; \
385+
fi
386+
376387
LOCAL_GINKGO_ARGS ?=
377388
LOCAL_GINKGO_ARGS += $(GINKGO_ARGS)
378389
.PHONY: test-e2e-local

controlplane/internal/controllers/rke2controlplane_controller.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,15 @@ func (r *RKE2ControlPlaneReconciler) updateStatus(ctx context.Context, rcp *cont
339339
}
340340

341341
if len(ownedMachines) == 0 {
342-
return fmt.Errorf("no Control Plane Machines exist for RKE2ControlPlane %s/%s", rcp.Namespace, rcp.Name)
342+
logger.Info(fmt.Sprintf("no Control Plane Machines exist for RKE2ControlPlane %s/%s", rcp.Namespace, rcp.Name))
343+
344+
return nil
343345
}
344346

345347
if len(readyMachines) == 0 {
346-
return fmt.Errorf("no Control Plane Machines are ready for RKE2ControlPlane %s/%s", rcp.Namespace, rcp.Name)
348+
logger.Info(fmt.Sprintf("no Control Plane Machines are ready for RKE2ControlPlane %s/%s", rcp.Namespace, rcp.Name))
349+
350+
return nil
347351
}
348352

349353
availableCPMachines := readyMachines

0 commit comments

Comments
 (0)