diff --git a/client.go b/client.go index a5e34432..6e35d5fb 100644 --- a/client.go +++ b/client.go @@ -965,8 +965,8 @@ func (c *Client[TTx]) runProducers(fetchNewWorkCtx, workCtx context.Context) { // usual. // // In the event the running job finishes executing _before_ the cancellation -// signal is received but _after_ this update was made, the behavior depends -// on which state the job is being transitioned into: +// signal is received but _after_ this update was made, the behavior depends on +// which state the job is being transitioned into (based on its return error): // // - If the job completed successfully, was cancelled from within, or was // discarded due to exceeding its max attempts, the job will be updated as @@ -1017,8 +1017,8 @@ func (c *Client[TTx]) Cancel(ctx context.Context, jobID int64) (*rivertype.JobRo // usual. // // In the event the running job finishes executing _before_ the cancellation -// signal is received but _after_ this update was made, the behavior depends -// on which state the job is being transitioned into: +// signal is received but _after_ this update was made, the behavior depends on +// which state the job is being transitioned into (based on its return error): // // - If the job completed successfully, was cancelled from within, or was // discarded due to exceeding its max attempts, the job will be updated as diff --git a/client_test.go b/client_test.go index c5ed4862..d54ff1c2 100644 --- a/client_test.go +++ b/client_test.go @@ -293,7 +293,9 @@ func Test_Client(t *testing.T) { return ctx.Err() })) + statusUpdateCh := client.monitor.RegisterUpdates() startClient(ctx, t, client) + waitForClientHealthy(ctx, t, statusUpdateCh) insertedJob, err := client.Insert(ctx, &JobArgs{}, nil) require.NoError(t, err)