cadence-client icon indicating copy to clipboard operation
cadence-client copied to clipboard

replayWorkflowHistory not returning failure on incompatible history

Open jianchun opened this issue 5 years ago • 0 comments

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

jianchun avatar Oct 14 '19 19:10 jianchun