Skip to content

Commit a80fbcd

Browse files
committed
run tests on loop until failure
1 parent f068d1c commit a80fbcd

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ test-verbose: ## Run unit and integration tests with race detector and with verb
925925

926926
.PHONY: test-junit
927927
test-junit: $(SETUP_ENVTEST) $(GOTESTSUM) ## Run unit and integration tests with race detector and generate a junit report
928-
set +o errexit; (KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -race -json ./... $(TEST_ARGS); echo $$? > $(ARTIFACTS)/junit.exitcode) | tee $(ARTIFACTS)/junit.stdout
928+
set +o errexit; (KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -count=1 -race -json ./... $(TEST_ARGS); echo $$? > $(ARTIFACTS)/junit.exitcode) | tee $(ARTIFACTS)/junit.stdout
929929
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml --raw-command cat $(ARTIFACTS)/junit.stdout
930930
exit $$(cat $(ARTIFACTS)/junit.exitcode)
931931
set +o errexit; (KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -run "^TestFuzzyConversion$$" -json ./... $(TEST_ARGS); echo $$? > $(ARTIFACTS)/junit-fuzz.exitcode) | tee $(ARTIFACTS)/junit-fuzz.stdout

internal/controllers/machine/machine_controller_status.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
// Additionally, this func should ensure that the conditions managed by this controller are always set in order to
4444
// comply with the recommendation in the Kubernetes API guidelines.
4545
func (r *Reconciler) updateStatus(ctx context.Context, s *scope) {
46+
log := ctrl.LoggerFrom(ctx)
4647
// Update status from the Bootstrap Config external resource.
4748
// Note: some of the status fields derived from the Bootstrap Config are managed in reconcileBootstrap, e.g. status.BootstrapReady, etc.
4849
// here we are taking care only of the delta (condition).
@@ -51,12 +52,15 @@ func (r *Reconciler) updateStatus(ctx context.Context, s *scope) {
5152
// Update status from the InfraMachine external resource.
5253
// Note: some of the status fields derived from the InfraMachine are managed in reconcileInfrastructure, e.g. status.InfrastructureReady, etc.
5354
// here we are taking care only of the delta (condition).
55+
log.V(6).Info("setting infrastructureReadyCondition")
5456
setInfrastructureReadyCondition(ctx, s.machine, s.infraMachine, s.infraMachineIsNotFound)
5557

5658
// Update status from the Node external resource.
5759
// Note: some of the status fields are managed in reconcileNode, e.g. status.NodeRef, etc.
5860
// here we are taking care only of the delta (condition).
61+
log.V(6).Info("getting clustercache healthcheckstate")
5962
healthCheckingState := r.ClusterCache.GetHealthCheckingState(ctx, client.ObjectKeyFromObject(s.cluster))
63+
log.V(6).Info("setting nodeHealthAndReadyConditions")
6064
setNodeHealthyAndReadyConditions(ctx, s.cluster, s.machine, s.node, s.nodeGetError, healthCheckingState, r.RemoteConditionsGracePeriod)
6165

6266
// Updates Machine status not observed from Bootstrap Config, InfraMachine or Node (update Machine's own status).

scripts/ci-test.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ cd "${REPO_ROOT}" || exit 1
2525
source "${REPO_ROOT}/hack/ensure-go.sh"
2626

2727
echo "*** Testing Cluster API ***"
28-
make test-junit
28+
# temp run on loop to try to catch flake
2929

30-
echo -e "\n*** Testing test/infrastructure folder ***\n"
31-
make test-infrastructure-junit
30+
CAPI_TEST_ENV_LOG_LEVEL=10
31+
while make test-junit; do :; done
3232

33-
echo -e "\n*** Testing Cluster API Runtime SDK test extension ***\n"
34-
make test-test-extension-junit
3533

36-
echo -e "\n*** Testing Cluster API testing framework ***\n"
37-
make test-framework-junit
34+
#echo -e "\n*** Testing test/infrastructure folder ***\n"
35+
#make test-infrastructure-junit
36+
#
37+
#echo -e "\n*** Testing Cluster API Runtime SDK test extension ***\n"
38+
#make test-test-extension-junit
39+
#
40+
#echo -e "\n*** Testing Cluster API testing framework ***\n"
41+
#make test-framework-junit

0 commit comments

Comments
 (0)