-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(e2e): stabilize TestTaskRunFailure test #8174
fix(e2e): stabilize TestTaskRunFailure test #8174
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/auto-cc |
/ok-to-test |
/retest-required |
08e312e
to
8ad46e2
Compare
8ad46e2
to
927613c
Compare
/auto-cc |
927613c
to
54fdb19
Compare
5919d77
to
3e1d622
Compare
ignoreStepFields := cmpopts.IgnoreFields(v1.StepState{}, "ImageID") | ||
if d := cmp.Diff(taskrun.Status.Steps, expectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" { | ||
t.Fatalf("-got, +want: %v", d) | ||
ignoreStepFields := cmpopts.IgnoreFields(v1.StepState{}, "ImageID", "Running") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore the Running
fields:
This case failed because the Running field was inconsistent.
=== NAME TestTaskRunFailure
taskrun_test.go:152: -got, +want: v1.StepState{
ContainerState: v1.ContainerState{
Waiting: nil,
- Running: s"&ContainerStateRunning{StartedAt:2024-09-02 04:01:41 +0000 UTC,}",
+ Running: nil,
- Terminated: nil,
+ Terminated: s"&ContainerStateTerminated{ExitCode:1,Signal:0,Reason:Error,Message:,StartedAt:0001-01-01 00:00:00 +0000 UTC,FinishedAt:0001-01-01 00:00:00 +0000 UTC,ContainerID:,}",
},
Name: "unnamed-2",
Container: "step-unnamed-2",
... // 1 ignored field
Results: nil,
Provenance: nil,
- TerminationReason: "",
+ TerminationReason: "Skipped",
Inputs: nil,
Outputs: nil,
}
taskrun_test.go:155: -got, +want: v1.StepState{
ContainerState: v1.ContainerState{
Waiting: nil,
- Running: s"&ContainerStateRunning{StartedAt:2024-09-02 04:01:41 +0000 UTC,}",
+ Running: nil,
Terminated: nil,
},
Name: "unnamed-2",
Container: "step-unnamed-2",
... // 1 ignored and 5 identical fields
}
```__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! /lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, vdemeester 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 |
Most of the time, if a middle step fails, the subsequent steps are immediately marked as skipped. However, in rare cases, the subsequent steps may not be marked as skipped in time. To ensure the stability of e2e, we adapted to this scenario.
3e1d622
to
1b6d193
Compare
/retest |
2 similar comments
/retest |
/retest |
/lgtm |
Most of the time, if a middle step fails, the subsequent steps are immediately marked as skipped. However, in rare cases, the subsequent steps may not be marked as skipped in time.
To ensure the stability of e2e, we adapted to this scenario.
Failed cases:
Fatal log
Code:
pipeline/test/taskrun_test.go
Lines 99 to 134 in dd36119
Debug stepStatuses
pipeline/pkg/reconciler/taskrun/taskrun.go
Lines 677 to 678 in 95fbf31
pipeline/pkg/pod/status.go
Lines 144 to 162 in 95fbf31
pipeline/pkg/pod/status.go
Lines 267 to 309 in 95fbf31
Normal e2e is successful
Accidental failure
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep/kind bug
Release Notes