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

HealthCheck run one test #23982

Closed
wants to merge 1 commit into from
Closed

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Sep 17, 2024

Does this PR introduce a user-facing change?


Signed-off-by: Jan Rodák <[email protected]>
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 17, 2024
Copy link
Contributor

openshift-ci bot commented Sep 17, 2024

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Sep 17, 2024
Copy link
Contributor

openshift-ci bot commented Sep 17, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Honny1
Once this PR has been reviewed and has the lgtm label, please assign saschagrunert for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


run_podman healthcheck run $ctrname
run_podman inspect $ctrname --format "{{.State.Health.Log}}" >&3
[ $(echo "$output" | grep -o "Hi" - | wc -l) -eq 1 ]
Copy link
Member

Choose a reason for hiding this comment

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

Please do not use this form of testing in bats. I know it's what the bats people themselves use, but it makes for impossible-to-understand error messages.

Actually, gimme a few more minutes, I'm not sure I understand the purpose of this PR. I think it can be refactored further.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying to figure out why the first time the podma healthcheck run command is run, two log entries are created. I am unable to reproduce this on the local machine.

Copy link
Member

Choose a reason for hiding this comment

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

@Honny1 I haven't looked deeply what you are doing but when you run podman run it will create and start the systemd timer right away which fires of the first healtcheck run so if you then manually run podman healthcheck run again you get a second run, this of course depends on the systemd

e.g.

$ bin/podman run --name c1 --health-cmd "echo hi" -d quay.io/libpod/testimage:20240123 sleep 100 && bin/podman healthcheck run c1 && podman inspect c1 --format "{{json .State.Health}}"
11249e7dcbd93e62e2e3d6af75be1664cc7961e2c340e5df53ab932442ba03c4
{"Status":"healthy","FailingStreak":0,"Log":[{"Start":"2024-09-17T18:55:11.63495862+02:00","End":"2024-09-17T18:55:11.730240069+02:00","ExitCode":0,"Output":"hi\n"},{"Start":"2024-09-17T18:55:11.676075091+02:00","End":"2024-09-17T18:55:11.753759388+02:00","ExitCode":0,"Output":"hi\n"}]}

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks that explains everything.

@Honny1 Honny1 closed this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants