Skip to content

Commit b7fce50

Browse files
committed
lint: errorlint
1 parent 1515a7a commit b7fce50

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

backend/redis/diagnostics_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func Test_Diag_GetWorkflowInstances(t *testing.T) {
2020
b := setup()
2121

2222
t.Cleanup(func() {
23-
b.Close()
23+
require.NoError(t, b.Close())
2424
})
2525

2626
bd := b.(diag.Backend)

backend/redis/expire_test.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func Test_AutoExpiration(t *testing.T) {
3636
return nil
3737
}
3838

39-
w.RegisterWorkflow(wf)
39+
require.NoError(t, w.RegisterWorkflow(wf))
4040

4141
wfi, err := c.CreateWorkflowInstance(ctx, client.WorkflowInstanceOptions{
4242
InstanceID: uuid.NewString(),
@@ -97,13 +97,15 @@ func Test_AutoExpiration_SubWorkflow(t *testing.T) {
9797
InstanceID: swfInstanceID,
9898
}, swf).Get(ctx)
9999

100-
workflow.ScheduleTimer(ctx, time.Second*2).Get(ctx)
100+
if _, err := workflow.ScheduleTimer(ctx, time.Second*2).Get(ctx); err != nil {
101+
return 0, err
102+
}
101103

102104
return r, err
103105
}
104106

105-
w.RegisterWorkflow(wf)
106-
w.RegisterWorkflow(swf)
107+
require.NoError(t, w.RegisterWorkflow(wf))
108+
require.NoError(t, w.RegisterWorkflow(swf))
107109

108110
wfi, err := c.CreateWorkflowInstance(ctx, client.WorkflowInstanceOptions{
109111
InstanceID: uuid.NewString(),
@@ -168,13 +170,15 @@ func Test_AutoExpiration_ContinueAsNew_SubWorkflow(t *testing.T) {
168170
InstanceID: swfInstanceID,
169171
}, swf, 0).Get(ctx)
170172

171-
workflow.ScheduleTimer(ctx, time.Second*2).Get(ctx)
173+
if _, err := workflow.ScheduleTimer(ctx, time.Second*2).Get(ctx); err != nil {
174+
return 0, err
175+
}
172176

173177
return r, err
174178
}
175179

176-
w.RegisterWorkflow(wf)
177-
w.RegisterWorkflow(swf)
180+
require.NoError(t, w.RegisterWorkflow(wf))
181+
require.NoError(t, w.RegisterWorkflow(swf))
178182

179183
wfi, err := c.CreateWorkflowInstance(ctx, client.WorkflowInstanceOptions{
180184
InstanceID: uuid.NewString(),

backend/redis/queue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ func Test_TaskQueue(t *testing.T) {
284284
q, err := newTaskQueue[any](ctx, client, "prefix", taskType, "")
285285
require.NoError(t, err)
286286

287-
q.Prepare(ctx, client, []workflow.Queue{workflow.QueueDefault})
287+
require.NoError(t, q.Prepare(ctx, client, []workflow.Queue{workflow.QueueDefault}))
288288

289289
tt.f(t, q)
290290
})

0 commit comments

Comments
 (0)