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 #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
  • Loading branch information
afrittoli authored and tekton-robot committed Jun 24, 2020
1 parent c944643 commit 9cfe709
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1beta1.PipelineRun) err
}
}

before := pr.Status.GetCondition(apis.ConditionSucceeded)
after := resources.GetPipelineConditionStatus(pr, pipelineState, logger, d)
switch after.Status {
case corev1.ConditionTrue:
Expand All @@ -452,8 +451,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 9cfe709

Please sign in to comment.