Skip to content

Commit

Permalink
Merge branch 'main' into kxd/remove-worker-injectables
Browse files Browse the repository at this point in the history
  • Loading branch information
efritz authored Jun 26, 2024
2 parents eee0bc8 + 6376d65 commit 50e365e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (w *Worker) Init(ctx context.Context) error {
return w.spec.Init(ctx)
}

func (w *Worker) Start(ctx context.Context) (err error) {
func (w *Worker) Run(ctx context.Context) (err error) {
if finalizer, ok := w.spec.(nacelle.Finalizer); ok {
defer func() {
finalizeErr := finalizer.Finalize(ctx)
Expand Down
16 changes: 8 additions & 8 deletions worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestRunAndStop(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

eventually(t, receiveStruct(tickChan))
Expand Down Expand Up @@ -104,7 +104,7 @@ func TestNonStrict(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

clock.BlockingAdvance(time.Minute)
Expand Down Expand Up @@ -187,7 +187,7 @@ func TestStrict(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

clock.BlockingAdvance(time.Second * 57)
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestFinalize(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand Down Expand Up @@ -323,7 +323,7 @@ func TestFinalizeError(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand Down Expand Up @@ -355,7 +355,7 @@ func TestFinalizeErrorDoesNotOverwrite(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand Down Expand Up @@ -383,7 +383,7 @@ func TestTickError(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

value := readErrorValue(t, errChan)
Expand All @@ -410,7 +410,7 @@ func TestTickContext(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand Down

0 comments on commit 50e365e

Please sign in to comment.