Skip to content

Commit

Permalink
fix(trial): move cancel func to t.Cleanup.
Browse files Browse the repository at this point in the history
Signed-off-by: Electronic-Waste <[email protected]>
  • Loading branch information
Electronic-Waste committed Sep 19, 2024
1 parent ddd2cb3 commit 6a7a528
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/controller.v1beta1/trial/trial_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func TestReconcileBatchJob(t *testing.T) {

// Start test manager
mgrCtx, cancel := context.WithCancel(context.TODO())
t.Cleanup(cancel)
go func() {
g.Expect(mgr.Start(mgrCtx)).NotTo(gomega.HaveOccurred())
}()
Expand Down Expand Up @@ -364,9 +365,6 @@ func TestReconcileBatchJob(t *testing.T) {
g := gomega.NewGomegaWithT(t)
g.Expect(r.updateStatus(&trialsv1beta1.Trial{})).To(gomega.HaveOccurred())
})

// Stop the test manager
cancel()
}

func TestGetObjectiveMetricValue(t *testing.T) {
Expand Down

0 comments on commit 6a7a528

Please sign in to comment.