pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Flake: PipelineRun unittests (TestReconcile_InvalidPipelineRuns)

Open lbernick opened this issue 2 years ago • 1 comments

https://prow.tekton.dev/view/gs/tekton-prow/pr-logs/pull/tektoncd_pipeline/5466/pull-tekton-pipeline-unit-tests/1569343520609669120

TestReconcile_InvalidPipelineRuns/invalid-pipeline-run-resources-not-bound-shd-stop-reconciling:

{Failed            }
          }
    pipelinerun_test.go:1320: error in test pipeline-resources-not-bound: received 2 events but 3 expected. Found events: []string{"Normal Started ", "Warning Failed PipelineRun foo/pipeline-resources-not-bound doesn't bind Pipeline foo/a-fine-pipeline's PipelineResources correctly: Pipeline's declared required resources are missing from the PipelineRun: [a-resource]"}}

While PipelineResources are deprecated and will be removed eventually, I think this is a more general issue with our PipelineRun unit tests that rely on events. We do have a FakeRecorded used in tests to record events, but we don't have an implementation of sending events for tests. (I think the issue is that the controller retries sending events, and the recorder may record duplicate events, which is what happened here.)

We could rewrite tests to filter out duplicate events, or we could provide a testing implementation of something that sends events and is allowed to block.

lbernick avatar Sep 12 '22 18:09 lbernick

Yeah, the bulk of our flaky unit tests that I've seen are either in cmd/entrypoint or event-based.

abayer avatar Sep 13 '22 14:09 abayer

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Dec 12 '22 14:12 tekton-robot

/assign

Yongxuanzhang avatar Jan 25 '23 18:01 Yongxuanzhang

closed in #6063

lbernick avatar Jan 27 '23 19:01 lbernick

Hope https://github.com/tektoncd/pipeline/pull/6063 can be a fix for this issue, we will continue to monitor the ci and see if it works

Yongxuanzhang avatar Jan 27 '23 21:01 Yongxuanzhang