@@ -26,6 +26,7 @@ package host
2626
2727import (
2828 "bytes"
29+ "context"
2930 "encoding/binary"
3031 "errors"
3132 "strconv"
@@ -45,7 +46,6 @@ import (
4546 "github.com/temporalio/temporal/common/log/tag"
4647 "github.com/temporalio/temporal/common/payloads"
4748 "github.com/temporalio/temporal/common/rpc"
48- "github.com/temporalio/temporal/service/history"
4949)
5050
5151func (s * integrationSuite ) TestQueryWorkflow_Sticky () {
@@ -687,7 +687,6 @@ func (s *integrationSuite) TestQueryWorkflow_Consistent_PiggybackQuery() {
687687 QueryType : queryType ,
688688 },
689689 QueryRejectCondition : rejectCondition ,
690- QueryConsistencyLevel : enumspb .QUERY_CONSISTENCY_LEVEL_STRONG ,
691690 })
692691 // after the query is answered the signal is handled because query is consistent and since
693692 // signal came before query signal must be handled by the time query returns
@@ -869,7 +868,6 @@ func (s *integrationSuite) TestQueryWorkflow_Consistent_Timeout() {
869868 QueryType : queryType ,
870869 },
871870 QueryRejectCondition : rejectCondition ,
872- QueryConsistencyLevel : enumspb .QUERY_CONSISTENCY_LEVEL_STRONG ,
873871 })
874872 cancel ()
875873 queryResultCh <- QueryResult {Resp : queryResp , Err : err }
@@ -1031,7 +1029,6 @@ func (s *integrationSuite) TestQueryWorkflow_Consistent_BlockedByStarted_NonStic
10311029 QueryType : queryType ,
10321030 },
10331031 QueryRejectCondition : rejectCondition ,
1034- QueryConsistencyLevel : enumspb .QUERY_CONSISTENCY_LEVEL_STRONG ,
10351032 })
10361033 s .True (handledSignal .Load ())
10371034 queryResultCh <- QueryResult {Resp : queryResp , Err : err }
@@ -1221,7 +1218,6 @@ func (s *integrationSuite) TestQueryWorkflow_Consistent_NewDecisionTask_Sticky()
12211218 QueryType : queryType ,
12221219 },
12231220 QueryRejectCondition : rejectCondition ,
1224- QueryConsistencyLevel : enumspb .QUERY_CONSISTENCY_LEVEL_STRONG ,
12251221 })
12261222 s .True (handledSignal .Load ())
12271223 queryResultCh <- QueryResult {Resp : queryResp , Err : err }
@@ -1342,15 +1338,16 @@ func (s *integrationSuite) TestQueryWorkflow_BeforeFirstDecision() {
13421338 RunId : we .RunId ,
13431339 }
13441340
1345- // query workflow without any decision task should produce an error
1346- queryResp , err := s .engine .QueryWorkflow (NewContext (), & workflowservice.QueryWorkflowRequest {
1341+ // query workflow without any decision task should timeout
1342+ ctx , cancel := context .WithTimeout (NewContext (), 1 * time .Second )
1343+ defer cancel ()
1344+ queryResp , err := s .engine .QueryWorkflow (ctx , & workflowservice.QueryWorkflowRequest {
13471345 Namespace : s .namespace ,
13481346 Execution : workflowExecution ,
13491347 Query : & querypb.WorkflowQuery {
13501348 QueryType : queryType ,
13511349 },
1352- QueryConsistencyLevel : enumspb .QUERY_CONSISTENCY_LEVEL_EVENTUAL ,
13531350 })
13541351 s .IsType (& workflowservice.QueryWorkflowResponse {}, queryResp )
1355- s .IsType (history . ErrQueryWorkflowBeforeFirstDecision , err )
1352+ s .IsType (& serviceerror. DeadlineExceeded {} , err )
13561353}
0 commit comments