@@ -30,30 +30,28 @@ import (
3030type testFlowService struct {
3131 dexpb.UnimplementedFlowServiceServer
3232
33- mu sync.Mutex
34- loadCalls int
35- loadRequest * dexpb.LoadBlobsRequest
36- startCalls int
37- stopCalls int
38- streamWriteCalls int
39- skipTimerCalls int
40- waitStepCalls int
41- updateConfigCalls int
42- continueAsNewCalls int
43- startRequest * dexpb.StartFlowRequest
44- stopRequest * dexpb.StopFlowRequest
45- streamWriteRequest * dexpb.WriteStreamRequest
46- waitRequest * dexpb.WaitForFlowRequest
47- skipTimerRequest * dexpb.SkipTimerRequest
48- waitStepRequest * dexpb.WaitForStepCompletionRequest
49- updateConfigRequest * dexpb.UpdateFlowConfigRequest
50- continueAsNewRequest * dexpb.TriggerContinueAsNewRequest
51- timeTravelCalls int
52- timeTravelRequest * dexpb.ResetFlowRequest
53- waitStarted chan struct {}
54- waitOnce sync.Once
55- serverInfo * dexpb.ServerInfo
56- serverInfoFailure error
33+ mu sync.Mutex
34+ loadCalls int
35+ loadRequest * dexpb.LoadBlobsRequest
36+ startCalls int
37+ stopCalls int
38+ streamWriteCalls int
39+ skipTimerCalls int
40+ waitStepCalls int
41+ updateConfigCalls int
42+ startRequest * dexpb.StartFlowRequest
43+ stopRequest * dexpb.StopFlowRequest
44+ streamWriteRequest * dexpb.WriteStreamRequest
45+ waitRequest * dexpb.WaitForFlowRequest
46+ skipTimerRequest * dexpb.SkipTimerRequest
47+ waitStepRequest * dexpb.WaitForStepCompletionRequest
48+ updateConfigRequest * dexpb.UpdateFlowConfigRequest
49+ timeTravelCalls int
50+ timeTravelRequest * dexpb.ResetFlowRequest
51+ waitStarted chan struct {}
52+ waitOnce sync.Once
53+ serverInfo * dexpb.ServerInfo
54+ serverInfoFailure error
5755}
5856
5957func (s * testFlowService ) GetServerInfo (
@@ -188,17 +186,6 @@ func (s *testFlowService) UpdateFlowConfig(
188186 return & emptypb.Empty {}, nil
189187}
190188
191- func (s * testFlowService ) TriggerContinueAsNew (
192- _ context.Context ,
193- request * dexpb.TriggerContinueAsNewRequest ,
194- ) (* emptypb.Empty , error ) {
195- s .mu .Lock ()
196- defer s .mu .Unlock ()
197- s .continueAsNewCalls ++
198- s .continueAsNewRequest = request
199- return & emptypb.Empty {}, nil
200- }
201-
202189func (s * testFlowService ) ResetFlow (
203190 _ context.Context ,
204191 request * dexpb.ResetFlowRequest ,
@@ -219,8 +206,8 @@ func (s *testFlowService) GetFlowSummary(
219206 flowStatus = dexpb .FlowStatus_FLOW_STATUS_COMPLETED
220207 }
221208 return & dexpb.GetFlowSummaryResponse {
222- FlowExecutionId : & dexpb.FlowExecutionID {FlowId : request .GetFlowId (), RunId : "run-1" },
223- FirstRunId : "run-1" , FlowType : "OrderFlow" , FlowStatus : flowStatus ,
209+ FlowRunId : & dexpb.FlowRunID {FlowId : request .GetFlowId (), RunId : "run-1" },
210+ FirstRunId : "run-1" , FlowType : "OrderFlow" , FlowStatus : flowStatus ,
224211 }, nil
225212}
226213
@@ -403,7 +390,7 @@ func TestFlowClientOperationsMapSDKEquivalentRequests(t *testing.T) {
403390 startResult := executeTestCommand (t , nil ,
404391 "flow" , "start" , "flow-1" , "--flow-type" , "OrderFlow" , "--start-step-type" , "StartOrder" ,
405392 "--input" , `{"order":42}` , "--attributes" , `[{"key":"status","value":"new","index":{"type":"keyword"},"sync":true}]` ,
406- "--config" , `{"activeStepSearchMode":"all","continueAsNewThreshold":12," stepDurability":"sync","offloadHistory":false}` ,
393+ "--config" , `{"activeStepSearchMode":"all","stepDurability":"sync","offloadHistory":false}` ,
407394 "--retry-policy" , `{"initialInterval":"1500ms","backoffCoefficient":2,"maximumInterval":"5s","maximumAttempts":3}` ,
408395 "--step-options" , `{"skipWaitFor":true}` , "--timeout-handler-options" , `{"methodTimeoutSeconds":20,"loadChannelNames":["commands"]}` ,
409396 "--flow-timeout" , "90s" , "--flow-timeout-policy" , "handler" ,
@@ -424,8 +411,7 @@ func TestFlowClientOperationsMapSDKEquivalentRequests(t *testing.T) {
424411
425412 executeTestCommand (t , nil , "flow" , "skip-timer" , "flow-1" , "--step-type" , "WaitForPayment" , "--execution" , "2" , "--condition-index" , "3" , "--yes" , "--server" , address )
426413 executeTestCommand (t , nil , "flow" , "wait-step" , "flow-1" , "--step-type" , "ShipOrder" , "--execution" , "2" , "--request-timeout" , "1500ms" , "--server" , address )
427- executeTestCommand (t , nil , "flow" , "update-config" , "flow-1" , "--config" , `{"continueAsNewPageSizeInBytes":1024,"attributeStoreNames":[],"historyWindowEvents":5000,"deleteExpiredHistoryObjects":false}` , "--yes" , "--server" , address )
428- executeTestCommand (t , nil , "flow" , "trigger-continue-as-new" , "flow-1" , "--yes" , "--server" , address )
414+ executeTestCommand (t , nil , "flow" , "update-config" , "flow-1" , "--config" , `{"attributeStoreNames":[],"historyWindowEvents":5000,"deleteExpiredHistoryObjects":false}` , "--yes" , "--server" , address )
429415
430416 service .mu .Lock ()
431417 defer service .mu .Unlock ()
@@ -459,12 +445,10 @@ func TestFlowClientOperationsMapSDKEquivalentRequests(t *testing.T) {
459445 if service .waitStepRequest .GetStepExecutionNumber () != "2" || service .waitStepRequest .GetRequestTimeoutSeconds () != 2 || service .waitStepRequest .GetRequestId () == "" {
460446 t .Fatalf ("unexpected wait-step request: %#v" , service .waitStepRequest )
461447 }
462- if service .updateConfigRequest .GetFlowConfig ().GetContinueAsNewPageSizeInBytes () != 1024 || service . updateConfigRequest . GetFlowConfig (). AttributeStoreNames == nil || len (service .updateConfigRequest .GetFlowConfig ().GetAttributeStoreNames ().GetNames ()) != 0 || service .updateConfigRequest .GetFlowConfig ().GetHistoryWindowEvents () != 5000 || service .updateConfigRequest .GetFlowConfig ().DeleteExpiredHistoryObjects != nil || service .updateConfigRequest .GetFlowConfig ().OffloadHistory != nil {
448+ if service .updateConfigRequest .GetFlowConfig ().AttributeStoreNames == nil || len (service .updateConfigRequest .GetFlowConfig ().GetAttributeStoreNames ().GetNames ()) != 0 || service .updateConfigRequest .GetFlowConfig ().GetHistoryWindowEvents () != 5000 || service .updateConfigRequest .GetFlowConfig ().DeleteExpiredHistoryObjects != nil || service .updateConfigRequest .GetFlowConfig ().OffloadHistory != nil {
463449 t .Fatalf ("unexpected update-config request: %#v" , service .updateConfigRequest )
464450 }
465- if service .continueAsNewRequest .GetFlowId () != "flow-1" {
466- t .Fatalf ("unexpected continue-as-new request: %#v" , service .continueAsNewRequest )
467- }
451+
468452}
469453
470454func TestFlowConfigRejectsWorkerTarget (t * testing.T ) {
@@ -499,7 +483,6 @@ func TestFlowMutationsRequireConfirmation(t *testing.T) {
499483 {"flow" , "start" , "flow-1" , "--flow-type" , "OrderFlow" , "--server" , address },
500484 {"flow" , "skip-timer" , "flow-1" , "--step-type" , "Wait" , "--condition-id" , "timer" , "--server" , address },
501485 {"flow" , "update-config" , "flow-1" , "--config" , `{}` , "--server" , address },
502- {"flow" , "trigger-continue-as-new" , "flow-1" , "--server" , address },
503486 } {
504487 app := NewApp (bytes .NewReader (nil ), & bytes.Buffer {}, & bytes.Buffer {})
505488 if err := app .Execute (context .Background (), args ); err == nil || ExitCode (err ) != 2 {
@@ -508,7 +491,7 @@ func TestFlowMutationsRequireConfirmation(t *testing.T) {
508491 }
509492 service .mu .Lock ()
510493 defer service .mu .Unlock ()
511- if service .startCalls != 0 || service .skipTimerCalls != 0 || service .updateConfigCalls != 0 || service . continueAsNewCalls != 0 {
494+ if service .startCalls != 0 || service .skipTimerCalls != 0 || service .updateConfigCalls != 0 {
512495 t .Fatalf ("mutation reached service without confirmation: %#v" , service )
513496 }
514497}
0 commit comments