Skip to content

Commit

Permalink
Emit event only once
Browse files Browse the repository at this point in the history
When finishReconcileUpdateEmitEvents was introduced in PR tektoncd#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: tektoncd#2857
  • Loading branch information
afrittoli committed Jun 24, 2020
1 parent c944643 commit 0a08b7a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a08b7a

Please sign in to comment.