Skip to content

Commit

Permalink
chore: use consts
Browse files Browse the repository at this point in the history
  • Loading branch information
rangoo94 committed Aug 13, 2024
1 parent 5652bfd commit 95a1911
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/testworkflows/testworkflowcontroller/podstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func initializePodState(parentCtx context.Context, pod Channel[*corev1.Pod], pod
} else if ok {
state.RegisterPod(p.Value)
}
case <-time.After(2 * time.Second):
case <-time.After(alignmentTimeout):
// Continue - likely we won't receive Pod status
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import (
)

const (
InitContainerName = "tktw-init"
IdleTimeout = 100 * time.Millisecond
InitContainerName = "tktw-init"
IdleTimeout = 100 * time.Millisecond
ExpectedDelayTimeout = 1 * time.Second
)

type WatchInstrumentedPodOptions struct {
Expand Down Expand Up @@ -80,7 +81,7 @@ func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interf
// Handle when the execution have been finished, but there may be no Pod
case <-state.Finished(""):
select {
case <-time.After(1 * time.Second):
case <-time.After(ExpectedDelayTimeout):
s.Error(fmt.Errorf("the execution is finished, but failed to get pod"))
return
case p := <-pod.Peek(ctx):
Expand Down

0 comments on commit 95a1911

Please sign in to comment.