Skip to content

Commit

Permalink
Refactor decodeString to accept require.TestingT (#6492)
Browse files Browse the repository at this point in the history
## What changed?
<!-- Describe what has changed in this PR -->
Refactor `decodeString` to accept `require.TestingT`.

## Why?
<!-- Tell your future self why have you made these changes -->
To be able to use with other test suites.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
Compile.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
No risks.

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
No.

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
No.
  • Loading branch information
alexshtin authored Sep 6, 2024
1 parent 3c49088 commit 4d19579
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 40 deletions.
8 changes: 5 additions & 3 deletions tests/functional.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ func (s *FunctionalSuite) closeShard(wid string) {
s.NoError(err)
}

func decodeString(s *FunctionalSuite, pls *commonpb.Payloads) string {
s.T().Helper()
func decodeString(t require.TestingT, pls *commonpb.Payloads) string {
if th, ok := t.(interface{ Helper() }); ok {
th.Helper()
}
var str string
err := payloads.Decode(pls, &str)
s.NoError(err)
require.NoError(t, err)
return str
}
74 changes: 37 additions & 37 deletions tests/update_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_EmptySpeculativeWorkflowTask_Accept
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(5, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -301,15 +301,15 @@ func (s *FunctionalSuite) TestUpdateWorkflow_EmptySpeculativeWorkflowTask_Accept
s.NoError(err)
s.NotNil(res.NewTask)
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

// Test non-blocking poll
for _, waitPolicy := range []*updatepb.WaitPolicy{{LifecycleStage: enumspb.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED}, nil} {
pollUpdateResp, err := s.pollUpdate(tv, "1", waitPolicy)
s.NoError(err)
s.Equal(enumspb.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED, pollUpdateResp.Stage)
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, pollUpdateResp.Outcome.GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), pollUpdateResp.Outcome.GetSuccess()))
// Even if tv doesn't have RunID, it should be returned as part of UpdateRef.
s.Equal(runID, pollUpdateResp.UpdateRef.GetWorkflowExecution().RunId)
}
Expand Down Expand Up @@ -404,7 +404,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_NotEmptySpeculativeWorkflowTask_Acc
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(6, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -437,7 +437,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_NotEmptySpeculativeWorkflowTask_Acc
s.NoError(err)
s.NotNil(res)
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

s.Equal(2, wtHandlerCalls)
Expand Down Expand Up @@ -511,7 +511,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_FirstNormalScheduledWorkflowTask_Ac
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(2, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -541,7 +541,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_FirstNormalScheduledWorkflowTask_Ac
s.NotNil(res)

updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

s.Equal(1, wtHandlerCalls)
Expand Down Expand Up @@ -620,7 +620,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_NormalScheduledWorkflowTask_AcceptC
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(6, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -658,7 +658,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_NormalScheduledWorkflowTask_AcceptC
s.NotNil(res)

updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

s.Equal(2, wtHandlerCalls)
Expand Down Expand Up @@ -1493,7 +1493,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_StickySpeculativeWorkflowTask_Accep
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(5, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -1534,7 +1534,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_StickySpeculativeWorkflowTask_Accep
time.Sleep(500 * time.Millisecond)
updateResult := <-s.sendUpdateNoError(tv, "1")

s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))

s.Equal(2, wtHandlerCalls)
s.Equal(2, msgHandlerCalls)
Expand Down Expand Up @@ -1595,7 +1595,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_StickySpeculativeWorkflowTask_Accep
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(5, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -1637,7 +1637,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_StickySpeculativeWorkflowTask_Accep
s.NoError(err)
s.NotNil(res)
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

s.Equal(2, wtHandlerCalls)
Expand Down Expand Up @@ -1687,7 +1687,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_FirstNormalScheduledWorkflowTask_Re
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(2, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -1783,7 +1783,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_EmptySpeculativeWorkflowTask_Reject
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(5, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -1911,7 +1911,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_NotEmptySpeculativeWorkflowTask_Rej
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(6, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -2084,13 +2084,13 @@ func (s *FunctionalSuite) TestUpdateWorkflow_1stAccept_2ndAccept_2ndComplete_1st
case 1:
upd1RequestMsg = task.Messages[0]
upd1Request := protoutils.UnmarshalAny[*updatepb.Request](s.T(), upd1RequestMsg.GetBody())
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, upd1Request.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), upd1Request.GetInput().GetArgs()))
s.EqualValues(2, upd1RequestMsg.GetEventId())
return s.UpdateAcceptMessages(tv, upd1RequestMsg, "1"), nil
case 2:
upd2RequestMsg = task.Messages[0]
upd2Request := protoutils.UnmarshalAny[*updatepb.Request](s.T(), upd2RequestMsg.GetBody())
s.Equal("args-value-of-"+tv.UpdateID("2"), decodeString(s, upd2Request.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("2"), decodeString(s.T(), upd2Request.GetInput().GetArgs()))
s.EqualValues(7, upd2RequestMsg.GetEventId())
return s.UpdateAcceptMessages(tv, upd2RequestMsg, "2"), nil
case 3:
Expand Down Expand Up @@ -2144,7 +2144,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_1stAccept_2ndAccept_2ndComplete_1st
s.NoError(err)
s.NotNil(res)
updateResult2 := <-updateResultCh2
s.EqualValues("success-result-of-"+tv.UpdateID("2"), decodeString(s, updateResult2.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("2"), decodeString(s.T(), updateResult2.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

err = poller.PollAndProcessActivityTask(false)
Expand All @@ -2156,7 +2156,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_1stAccept_2ndAccept_2ndComplete_1st
s.NotNil(res)
updateResult1 := <-updateResultCh1
s.Equal(enumspb.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED, updateResult1.Stage)
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult1.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult1.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

s.Equal(4, wtHandlerCalls)
Expand Down Expand Up @@ -2258,13 +2258,13 @@ func (s *FunctionalSuite) TestUpdateWorkflow_1stAccept_2ndReject_1stComplete() {
case 1:
upd1RequestMsg = task.Messages[0]
upd1Request := protoutils.UnmarshalAny[*updatepb.Request](s.T(), upd1RequestMsg.GetBody())
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, upd1Request.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), upd1Request.GetInput().GetArgs()))
s.EqualValues(2, upd1RequestMsg.GetEventId())
return s.UpdateAcceptMessages(tv, upd1RequestMsg, "1"), nil
case 2:
upd2RequestMsg := task.Messages[0]
upd2Request := protoutils.UnmarshalAny[*updatepb.Request](s.T(), upd2RequestMsg.GetBody())
s.Equal("args-value-of-"+tv.UpdateID("2"), decodeString(s, upd2Request.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("2"), decodeString(s.T(), upd2Request.GetInput().GetArgs()))
s.EqualValues(7, upd2RequestMsg.GetEventId())
return s.UpdateRejectMessages(tv, upd2RequestMsg, "2"), nil
case 3:
Expand Down Expand Up @@ -2318,7 +2318,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_1stAccept_2ndReject_1stComplete() {
s.NoError(err)
s.NotNil(res)
updateResult1 := <-updateResultCh1
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult1.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult1.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

s.Equal(3, wtHandlerCalls)
Expand Down Expand Up @@ -2850,7 +2850,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_StartToClos
s.NoError(err)
updateResp := res.NewTask
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, updateResp.ResetHistoryEventId)
s.Nil(updateResp.GetWorkflowTask())

Expand Down Expand Up @@ -3007,7 +3007,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_ScheduleToS
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(7, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -3856,7 +3856,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_FirstNormalWorkflowTask_UpdateResur

// Client receives resurrected Update outcome.
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))

// Signal to create new WFT which shouldn't get any updates.
err = s.sendSignal(s.namespace, tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String())
Expand Down Expand Up @@ -3957,8 +3957,8 @@ func (s *FunctionalSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTask_De
updateResp := res.NewTask
updateResult := <-updateResultCh
updateResult2 := <-updateResultCh2
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult2.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult2.GetOutcome().GetSuccess()))
s.EqualValues(0, updateResp.ResetHistoryEventId)

s.Equal(2, wtHandlerCalls)
Expand Down Expand Up @@ -4049,11 +4049,11 @@ func (s *FunctionalSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_Dedu
s.NoError(err)
s.NotNil(res)
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, res.NewTask.ResetHistoryEventId)

updateResult2 := <-updateResultCh2
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult2.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult2.GetOutcome().GetSuccess()))

s.Equal(2, wtHandlerCalls)
s.Equal(2, msgHandlerCalls)
Expand Down Expand Up @@ -4161,7 +4161,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_CompletedSpeculativeWorkflowTask_De
_, err = poller.PollAndProcessWorkflowTask()
s.NoError(err)
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))

if tc.CloseShard {
// Close shard to make sure that for completed updates deduplication works even after shard reload.
Expand All @@ -4184,7 +4184,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_CompletedSpeculativeWorkflowTask_De

s.EqualValues(
"success-result-of-"+tv.UpdateID("1"),
decodeString(s, updateResult2.GetOutcome().GetSuccess()),
decodeString(s.T(), updateResult2.GetOutcome().GetSuccess()),
"results of the first update must be available")

// Send signal to schedule new WT.
Expand Down Expand Up @@ -4661,7 +4661,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_WorkerSkipp
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.EqualValues(5, updRequestMsg.GetEventId())

// Don't process update in WT.
Expand All @@ -4671,7 +4671,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_WorkerSkipp
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("2"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("2"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.EqualValues(5, updRequestMsg.GetEventId())
return s.UpdateAcceptCompleteMessages(tv, updRequestMsg, "2"), nil
default:
Expand Down Expand Up @@ -4710,7 +4710,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_WorkerSkipp
s.NoError(err)
s.NotNil(update2Resp)
update2Result := <-update2ResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("2"), decodeString(s, update2Result.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("2"), decodeString(s.T(), update2Result.GetOutcome().GetSuccess()))

s.Equal(3, wtHandlerCalls)
s.Equal(3, msgHandlerCalls)
Expand Down Expand Up @@ -4814,7 +4814,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_QueryFailur
updRequestMsg := task.Messages[0]
updRequest := protoutils.UnmarshalAny[*updatepb.Request](s.T(), updRequestMsg.GetBody())

s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s, updRequest.GetInput().GetArgs()))
s.Equal("args-value-of-"+tv.UpdateID("1"), decodeString(s.T(), updRequest.GetInput().GetArgs()))
s.Equal(tv.HandlerName(), updRequest.GetInput().GetName())
s.EqualValues(5, updRequestMsg.GetEventId())

Expand Down Expand Up @@ -4899,7 +4899,7 @@ func (s *FunctionalSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_QueryFailur
s.NoError(err)
updateResp := res.NewTask
updateResult := <-updateResultCh
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s, updateResult.GetOutcome().GetSuccess()))
s.EqualValues("success-result-of-"+tv.UpdateID("1"), decodeString(s.T(), updateResult.GetOutcome().GetSuccess()))
s.EqualValues(0, updateResp.ResetHistoryEventId)

s.Equal(2, wtHandlerCalls)
Expand Down

0 comments on commit 4d19579

Please sign in to comment.