Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions pkg/runner-provisioner/provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,28 +193,6 @@ var _ = Describe("RunnerProvisioner", func() {
Expect(mockActions.DeleteRunnerCalls).To(Equal(1))
})
})

Context("when context is cancelled", func() {
It("should stop polling and return", func() {
cancelCtx, cancel := context.WithCancel(ctx)

// Runner never de-registers, but we'll cancel the context
mockActions.GetRunnerFunc = func(ctx context.Context, runnerName string) (*types.RunnerReference, error) {
// Cancel context after first check
cancel()
return &types.RunnerReference{Id: 888, Name: runnerName}, nil
}
mockActions.DeleteRunnerFunc = func(ctx context.Context, runnerID int) error {
return nil
}

_ = provisioner.ensureRunnerDeregistered(cancelCtx, testRunnerName)

// Should have attempted at least one check and force-deleted
Expect(mockActions.GetRunnerCalls).To(BeNumerically(">=", 1))
Expect(mockActions.DeleteRunnerCalls).To(Equal(1))
})
})
})

Describe("forceDeleteRunner", func() {
Expand Down