Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkinsfile: WAIT FOR UPGRADE VERSION #910

Merged
Merged
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 @@ -151,8 +151,6 @@ END
--privileged "${QUAY_BENCHMARK_RUNNER_REPOSITORY}"

"""
// Set the flag to indicate that upgrade steps are completed
currentBuild.description = "UpgradeStageCompleted"
}
}
}
Expand All @@ -172,12 +170,8 @@ END
def WINDOWS_URL = ''
def SCALE = ''
def workload_name = ''
def retryCount = 3 // Number of retries per workload
// while
while (currentBuild.description != "UpgradeStageCompleted") {
for (workload in workloads) {
boolean success = false
for (int i = 0; i < retryCount && !success; i++) {
boolean success = false
try {
// workload full name
workload_name = workload
Expand Down Expand Up @@ -264,14 +258,12 @@ END
} else {
echo "Reached maximum retry attempts for workload ${workload}. Moving to the next workload..."
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above here, do you need to check that the sudo podman run succeeds before success = true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think it necessary

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It's a simple check, and things can go wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its only on failure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're relying on something raising an excception if something goes wrong, but what if the podman run simply fails? Shouldn't that be treated as a failure?

Copy link
Collaborator Author

@ebattat ebattat Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more for failure inside the container, If podman run will fail, I prefer that all the run the will fail and not continue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but that's why you should check whether the podman run fails -- if it fails, then you fail the entire run.

}
if (!success) {
echo "Workload ${workload} failed after ${retryCount} retries."
}
// sleep 10 sec between each VMs validation interation
sleep(time: 10, unit: 'SECONDS')
} // while
}
}
}
Expand Down