Skip to content

Commit c19a0d0

Browse files
committed
flakyness
1 parent eb7fc69 commit c19a0d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dbos/client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ func TestCancelResume(t *testing.T) {
300300
originalDeadline := cancelStatus.Deadline
301301

302302
// Resume the workflow
303-
resumeStart := time.Now()
304303
resumeHandle, err := ResumeWorkflow[string](clientCtx, workflowID)
305304
require.NoError(t, err, "failed to resume workflow")
305+
resumeStart := time.Now()
306306

307307
// Get status after resume to check the deadline
308308
resumeStatus, err := resumeHandle.GetStatus()
@@ -312,8 +312,8 @@ func TestCancelResume(t *testing.T) {
312312
assert.False(t, resumeStatus.Deadline.Equal(originalDeadline), "expected deadline to be reset after resume, but it remained the same: %v", originalDeadline)
313313

314314
// The new deadline should be after resumeStart + workflowTimeout
315-
expectedDeadline := resumeStart.Add(workflowTimeout + 100*time.Millisecond) // 100ms buffer
316-
assert.False(t, resumeStatus.Deadline.Before(expectedDeadline), "deadline %v is too early (expected around %v)", resumeStatus.Deadline, expectedDeadline)
315+
expectedDeadline := resumeStart.Add(workflowTimeout - 100*time.Millisecond) // Allow some leeway for processing time
316+
assert.True(t, resumeStatus.Deadline.After(expectedDeadline), "deadline %v is too early (expected around %v)", resumeStatus.Deadline, expectedDeadline)
317317

318318
// Wait for the workflow to complete
319319
_, err = resumeHandle.GetResult()

0 commit comments

Comments
 (0)