From 0a08b7ad1ad2529f9e2121d0033b1cfe70211f53 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Wed, 24 Jun 2020 22:39:46 +0100 Subject: [PATCH] Emit event only once When finishReconcileUpdateEmitEvents was introduced in PR #2805, I forgot to remove one of the original event.Emit, so one event was sent twice. The fake recorder sometimes probably recognised the duplicate and filtered it out, causing flackiness in tests, as unit tests expect a fixed number of events. Thanks @GregDritschler for troubleshooting this! Fixes: #2857 --- pkg/reconciler/pipelinerun/pipelinerun.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/reconciler/pipelinerun/pipelinerun.go b/pkg/reconciler/pipelinerun/pipelinerun.go index 2d0ab0cf564..fc507ebaa18 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun.go +++ b/pkg/reconciler/pipelinerun/pipelinerun.go @@ -452,8 +452,6 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1beta1.PipelineRun) err } // Read the condition the way it was set by the Mark* helpers after = pr.Status.GetCondition(apis.ConditionSucceeded) - events.Emit(recorder, before, after, pr) - pr.Status.TaskRuns = getTaskRunsStatus(pr, pipelineState) logger.Infof("PipelineRun %s status is being set to %s", pr.Name, after) return nil