Skip to content

Commit ee0f4b0

Browse files
committed
nits
1 parent 3549ee0 commit ee0f4b0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

dbos/queues_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ func TestQueueTimeouts(t *testing.T) {
855855
// This workflow will wait indefinitely until it is cancelled
856856
<-ctx.Done()
857857
if !errors.Is(ctx.Err(), context.Canceled) && !errors.Is(ctx.Err(), context.DeadlineExceeded) {
858-
t.Fatalf("workflow was cancelled, but context error is not context.Canceled: %v", ctx.Err())
858+
t.Fatalf("workflow was cancelled, but context error is not context.Canceled nor context.DeadlineExceeded: %v", ctx.Err())
859859
}
860860
return "", ctx.Err()
861861
}
@@ -879,6 +879,16 @@ func TestQueueTimeouts(t *testing.T) {
879879
if dbosErr.Code != AwaitedWorkflowCancelled {
880880
t.Fatalf("expected error code to be AwaitedWorkflowCancelled, got %v", dbosErr.Code)
881881
}
882+
883+
// enqueud workflow should have been cancelled
884+
status, err := handle.GetStatus()
885+
if err != nil {
886+
t.Fatalf("failed to get status of enqueued workflow: %v", err)
887+
}
888+
if status.Status != WorkflowStatusCancelled {
889+
t.Fatalf("expected enqueued workflow status to be WorkflowStatusCancelled, got %v", status.Status)
890+
}
891+
882892
return "should-never-see-this", nil
883893
}
884894
RegisterWorkflow(dbosCtx, enqueuedWorkflowEnqueuesATimeoutWorkflow)

dbos/workflows_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ func TestWorkflowTimeout(t *testing.T) {
19701970
// This workflow will wait indefinitely until it is cancelled
19711971
<-ctx.Done()
19721972
if !errors.Is(ctx.Err(), context.Canceled) && !errors.Is(ctx.Err(), context.DeadlineExceeded) {
1973-
t.Fatalf("workflow was cancelled, but context error is not context.Canceled: %v", ctx.Err())
1973+
t.Fatalf("workflow was cancelled, but context error is not context.Canceled nor context.DeadlineExceeded: %v", ctx.Err())
19741974
}
19751975
return "", ctx.Err()
19761976
}
@@ -2036,7 +2036,7 @@ func TestWorkflowTimeout(t *testing.T) {
20362036
// This step will trigger cancellation of the entire workflow context
20372037
<-ctx.Done()
20382038
if !errors.Is(ctx.Err(), context.Canceled) && !errors.Is(ctx.Err(), context.DeadlineExceeded) {
2039-
t.Fatalf("step was cancelled, but context error is not context.Canceled: %v", ctx.Err())
2039+
t.Fatalf("step was cancelled, but context error is not context.Canceled nor context.DeadlineExceeded: %v", ctx.Err())
20402040
}
20412041
return "", ctx.Err()
20422042
}

0 commit comments

Comments
 (0)