diff --git a/integ/wf_state_api_timeout_test.go b/integ/wf_state_api_timeout_test.go index 6302c282..48db85b5 100644 --- a/integ/wf_state_api_timeout_test.go +++ b/integ/wf_state_api_timeout_test.go @@ -7,12 +7,22 @@ import ( "github.com/indeedeng/iwf/service" "github.com/indeedeng/iwf/service/common/ptr" "github.com/stretchr/testify/assert" + "net/http" "strconv" "strings" "testing" "time" ) +func panicAtHttpError(err error, httpResp *http.Response) { + if err != nil { + panic(err) + } + if httpResp.StatusCode != http.StatusOK { + panic("Status not success" + httpResp.Status) + } +} + func TestStateApiTimeoutTemporal(t *testing.T) { if !*temporalIntegTest { t.Skip() @@ -72,14 +82,16 @@ func doTestStateApiTimeout(t *testing.T, backendType service.BackendType, config WorkflowConfigOverride: config, }, }).Execute() - failTestAtHttpError(err, httpResp, t) + // failTestAtHttpError(err, httpResp, t) + panicAtHttpError(err, httpResp) // wait for the workflow reqWait := apiClient.DefaultApi.ApiV1WorkflowGetWithWaitPost(context.Background()) resp, httpResp, err := reqWait.WorkflowGetRequest(iwfidl.WorkflowGetRequest{ WorkflowId: wfId, }).Execute() - failTestAtHttpError(err, httpResp, t) + // failTestAtHttpError(err, httpResp, t) + panicAtHttpError(err, httpResp) history, _ := wfHandler.GetTestResult() assertions := assert.New(t) diff --git a/integ/workflow/wf_state_api_timeout/routers.go b/integ/workflow/wf_state_api_timeout/routers.go index 4799124d..0c849c38 100644 --- a/integ/workflow/wf_state_api_timeout/routers.go +++ b/integ/workflow/wf_state_api_timeout/routers.go @@ -54,8 +54,8 @@ func (h *handler) ApiV1WorkflowStateStart(c *gin.Context, t *testing.T) { return } } - fmt.Println( - fmt.Sprintf("WorkflowType: %v", req.GetWorkflowType()), + fmt.Printf( + "WorkflowType: %v", req.GetWorkflowType(), ) helpers.FailTestWithErrorMessage("should not get here", t) }