Skip to content

Commit

Permalink
Merge branch 'master' into nexus-workflow-alias
Browse files Browse the repository at this point in the history
  • Loading branch information
bergundy authored Jan 8, 2025
2 parents 30e80e4 + 423a9a3 commit ede1b9b
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions test/nexus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,6 @@ func TestAsyncOperationFromWorkflow(t *testing.T) {
switch action {
case "wait-for-started":
fut.GetNexusOperationExecution().Get(ctx, nil)
case "sleep":
workflow.Sleep(ctx, time.Millisecond)
}
cancel()
})
Expand Down Expand Up @@ -764,21 +762,6 @@ func TestAsyncOperationFromWorkflow(t *testing.T) {
}
})

t.Run("OpCanceledBeforeStarted", func(t *testing.T) {
run, err := tc.client.SignalWithStartWorkflow(ctx, uuid.NewString(), "cancel-op", "sleep", client.StartWorkflowOptions{
TaskQueue: tc.taskQueue,
}, callerWorkflow, "fail-to-start")
require.NoError(t, err)
var execErr *temporal.WorkflowExecutionError
err = run.Get(ctx, nil)
require.ErrorAs(t, err, &execErr)
// The Go SDK unwraps workflow errors to check for cancelation even if the workflow was never canceled, losing
// the error chain, Nexus operation errors are treated the same as other workflow errors for consistency.
var canceledErr *temporal.CanceledError
err = execErr.Unwrap()
require.ErrorAs(t, err, &canceledErr)
})

t.Run("OpCanceledAfterStarted", func(t *testing.T) {
run, err := tc.client.SignalWithStartWorkflow(ctx, uuid.NewString(), "cancel-op", "wait-for-started", client.StartWorkflowOptions{
TaskQueue: tc.taskQueue,
Expand Down

0 comments on commit ede1b9b

Please sign in to comment.