Skip to content

Commit

Permalink
Add stop and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdurham committed Oct 17, 2024
1 parent 8856717 commit b0c9409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/component/prometheus/operator/common/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ type cancelHandler struct {
func (ch *cancelHandler) Set(cncl context.CancelFunc) {
ch.mut.Lock()
defer ch.mut.Unlock()

ch.cancel = cncl
}

func (ch *cancelHandler) Cancel() {
ch.mut.Lock()
defer ch.mut.Unlock()

if ch.alreadyTrigger {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func TestRunExit(t *testing.T) {
// Stop the component.
// It shouldn't stop immediately, because the CRD Manager is hung.
cancelFunc()
time.Sleep(5 * time.Second)
<-stopRun

require.Eventually(t, func() bool {
Expand Down

0 comments on commit b0c9409

Please sign in to comment.