Skip to content

Conversation

@sebsoto
Copy link
Contributor

@sebsoto sebsoto commented Aug 21, 2025

We are reporting jobs as failed if a pod within the job failed. This is incorrect logic, as a single pod failing is not a failure state for the entire job. The job will keep creating pods until a success is seen.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2025
@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 21, 2025

/approve cancel

@openshift-ci openshift-ci bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2025
@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 21, 2025

Copy link
Contributor

@jrvaldes jrvaldes left a comment

Choose a reason for hiding this comment

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

@sebsoto thanks for fixing this. Mostly LGTM, see comments for remarks.

if err != nil {
return "", err
}
labelSelector = "job-name=" + job.Name
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend leaving this assignment here; it is a better practice to build the selector based on a job that exists ( i.e. L119) and lower the prob for errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats fair, reverted.

Comment on lines 1131 to 1138
if job.Status.Failed > 0 {
_, err = tc.gatherPodLogs(labelSelector)
if err != nil {
log.Printf("Unable to get logs associated with pod %s: %v", labelSelector, err)
}
events, _ := tc.getPodEvents(name)
return "", fmt.Errorf("job %v failed: %v", job, events)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be a case-by-case scenario. Currently, the logic followes no failures and one success, is there a case where we need to track a failure? if so consider passing an argument to controll it, e.g. MaxFailureCount

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just reworked the logic to account for this.
The caller should define the success criteria when creating the job.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, LGTM

@sebsoto sebsoto force-pushed the fixTestJobLogic branch 2 times, most recently from 5db43d1 to 63c015e Compare August 21, 2025 13:45
Copy link
Contributor

@jrvaldes jrvaldes left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jrvaldes

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jrvaldes

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

The pull request process is described 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

@sebsoto sebsoto force-pushed the fixTestJobLogic branch 2 times, most recently from 1e0953a to 20c4841 Compare August 21, 2025 13:59
@sebsoto sebsoto changed the title Fix job success logic OCPBUGS-60771: Fix job success logic Aug 21, 2025
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 21, 2025
@openshift-ci-robot
Copy link

@sebsoto: This pull request references Jira Issue OCPBUGS-60771, which is invalid:

  • expected the bug to target the "4.20.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

We are reporting jobs as failed if a pod within the job failed. This is incorrect logic, as a single pod failing is not a failure state for the entire job. The job will keep creating pods until a success is seen.

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 openshift-eng/jira-lifecycle-plugin repository.

@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 21, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 21, 2025
@openshift-ci-robot
Copy link

@sebsoto: This pull request references Jira Issue OCPBUGS-60771, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @rrasouli

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from rrasouli August 21, 2025 14:41
@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 21, 2025

/cherry-pick release-4.19

@openshift-cherrypick-robot

@sebsoto: once the present PR merges, I will cherry-pick it on top of release-4.19 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.19

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.

We are reporting jobs as failed if a pod within the job failed. This is
incorrect logic, as a single pod failing is not a failure state for the
entire job. The job will keep creating pods until a success is seen.
@jrvaldes
Copy link
Contributor

/cherry-pick release-4.19

Given the changes are only targeting the tests, they can be backported to all active branches.

@wgahnagl
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 27, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD f4500ad and 2 for PR HEAD b1082ea in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD f4500ad and 2 for PR HEAD b1082ea in total

@sebsoto
Copy link
Contributor Author

sebsoto commented Aug 27, 2025

/override ci/prow/nutanix-e2e-operator

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 27, 2025

@sebsoto: Overrode contexts on behalf of sebsoto: ci/prow/nutanix-e2e-operator

In response to this:

/override ci/prow/nutanix-e2e-operator

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-merge-bot openshift-merge-bot bot merged commit d3376c3 into openshift:master Aug 27, 2025
18 checks passed
@openshift-ci-robot
Copy link

@sebsoto: Jira Issue OCPBUGS-60771: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-60771 has been moved to the MODIFIED state.

In response to this:

We are reporting jobs as failed if a pod within the job failed. This is incorrect logic, as a single pod failing is not a failure state for the entire job. The job will keep creating pods until a success is seen.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 27, 2025

@sebsoto: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-cherrypick-robot

@sebsoto: new pull request created: #3234

In response to this:

/cherry-pick release-4.19

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants