Skip to content

Commit a038fb0

Browse files
committed
deleted workflow_getresult_options_test.go and rewrite in workflows_test.go
1 parent 307d41a commit a038fb0

File tree

2 files changed

+21
-174
lines changed

2 files changed

+21
-174
lines changed

dbos/workflow_getresult_options_test.go

Lines changed: 0 additions & 153 deletions
This file was deleted.

dbos/workflows_test.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,21 +4543,21 @@ func TestWorkflowIdentity(t *testing.T) {
45434543
})
45444544
}
45454545

4546-
func TestWorkflowHandleTimeout(t *testing.T) {
4547-
dbosCtx := setupDBOS(t, true, true)
4548-
RegisterWorkflow(dbosCtx, slowWorkflow)
4546+
func TestWorkflowHandles(t *testing.T) {
4547+
dbosCtx := setupDBOS(t, true, true)
4548+
RegisterWorkflow(dbosCtx, slowWorkflow)
45494549

4550-
t.Run("WorkflowHandleTimeout", func(t *testing.T) {
4551-
handle, err := RunWorkflow(dbosCtx, slowWorkflow, 10*time.Second)
4552-
require.NoError(t, err, "failed to start workflow")
4550+
t.Run("WorkflowHandleTimeout", func(t *testing.T) {
4551+
handle, err := RunWorkflow(dbosCtx, slowWorkflow, 10*time.Second)
4552+
require.NoError(t, err, "failed to start workflow")
45534553

4554-
start := time.Now()
4555-
_, err = handle.GetResult(WithHandleTimeout(10 * time.Millisecond))
4556-
duration := time.Since(start)
4554+
start := time.Now()
4555+
_, err = handle.GetResult(WithHandleTimeout(10*time.Millisecond), WithPollingInterval(1*time.Millisecond))
4556+
duration := time.Since(start)
45574557

4558-
require.Error(t, err, "expected timeout error")
4559-
assert.Contains(t, err.Error(), "workflow result timeout")
4560-
assert.True(t, duration < 100*time.Millisecond, "timeout should occur quickly")
4558+
require.Error(t, err, "expected timeout error")
4559+
assert.Contains(t, err.Error(), "workflow result timeout")
4560+
assert.True(t, duration < 100*time.Millisecond, "timeout should occur quickly")
45614561
assert.True(t, errors.Is(err, context.DeadlineExceeded),
45624562
"expected error to be detectable as context.DeadlineExceeded, got: %v", err)
45634563
})
@@ -4567,18 +4567,18 @@ func TestWorkflowHandleTimeout(t *testing.T) {
45674567
originalHandle, err := RunWorkflow(dbosCtx, slowWorkflow, 10*time.Second)
45684568
require.NoError(t, err, "failed to start workflow")
45694569

4570-
pollingHandle, err := RetrieveWorkflow[string](dbosCtx, originalHandle.GetWorkflowID())
4571-
require.NoError(t, err, "failed to retrieve workflow")
4570+
pollingHandle, err := RetrieveWorkflow[string](dbosCtx, originalHandle.GetWorkflowID())
4571+
require.NoError(t, err, "failed to retrieve workflow")
45724572

4573-
_, ok := pollingHandle.(*workflowPollingHandle[string])
4574-
require.True(t, ok, "expected polling handle, got %T", pollingHandle)
4573+
_, ok := pollingHandle.(*workflowPollingHandle[string])
4574+
require.True(t, ok, "expected polling handle, got %T", pollingHandle)
45754575

4576-
_, err = pollingHandle.GetResult(WithHandleTimeout(10 * time.Millisecond))
4576+
_, err = pollingHandle.GetResult(WithHandleTimeout(10*time.Millisecond), WithPollingInterval(1*time.Millisecond))
45774577

4578-
require.Error(t, err, "expected timeout error")
4579-
assert.True(t, errors.Is(err, context.DeadlineExceeded),
4580-
"expected error to be detectable as context.DeadlineExceeded, got: %v", err)
4581-
})
4578+
require.Error(t, err, "expected timeout error")
4579+
assert.True(t, errors.Is(err, context.DeadlineExceeded),
4580+
"expected error to be detectable as context.DeadlineExceeded, got: %v", err)
4581+
})
45824582
}
45834583

45844584
func TestWorkflowHandleContextCancel(t *testing.T) {

0 commit comments

Comments
 (0)