cadence-client
cadence-client copied to clipboard
replayWorkflowHistory not returning failure on incompatible history
Was testing an incompatible workflow change with worker.ReplayWorkflowHistoryFromJSONFile
. The test dumps ERROR internal/internal_task_handlers.go:1338 Workflow panic
to output but test result is PASS, as ReplayWorkflowHistoryFromJSONFile
not returning error.
Following code seems confusing:
if last.GetEventType() != shared.EventTypeWorkflowExecutionCompleted && last.GetEventType() != shared.EventTypeWorkflowExecutionContinuedAsNew {
return nil
}
err = fmt.Errorf("replay workflow doesn't return the same result as the last event, resp: %v, last: %v", resp, last)
last
refers to events[len(events) - 1]
. Mine has value EventTypeDecisionTaskFailed
, so above code returns nil.
And seems there is no comparison between resp
vs last
, not sure what the next err message referring to.
@longquanzheng