@@ -7786,7 +7786,7 @@ func (ts *IntegrationTestSuite) TestGrpcMessageTooLarge() {
77867786 ts .Fail ("Workflow task failed event not found in history" )
77877787 }
77887788
7789- veryLargeData := strings .Repeat ("Very Large Data " , 500_000 ) // circa 8MB, double the default 4MB limit
7789+ veryLargeData := slices .Repeat ([] byte { 1 }, 8_000_000 ) // double the default 4MB limit
77907790
77917791 ctx , cancel := context .WithCancel (context .Background ())
77927792 defer cancel ()
@@ -7799,16 +7799,16 @@ func (ts *IntegrationTestSuite) TestGrpcMessageTooLarge() {
77997799 if success {
78007800 return workflow .ExecuteActivity (ctx , activityFn , veryLargeData ).Get (ctx , nil )
78017801 } else {
7802- return errors . New ( veryLargeData )
7802+ return temporal . NewApplicationError ( "We should not see this error" , "" , veryLargeData )
78037803 }
78047804 }
78057805
78067806 failureInQueryTaskWorkflowFn := func (ctx workflow.Context ) error {
7807- return workflow .SetQueryHandler (ctx , "too-large-query" , func (success bool ) (string , error ) {
7807+ return workflow .SetQueryHandler (ctx , "too-large-query" , func (success bool ) ([] byte , error ) {
78087808 if success {
78097809 return veryLargeData , nil
78107810 } else {
7811- return "" , errors . New ( veryLargeData )
7811+ return nil , temporal . NewApplicationError ( "We should not see this error" , "" , veryLargeData )
78127812 }
78137813 })
78147814 }
@@ -7843,6 +7843,6 @@ func (ts *IntegrationTestSuite) TestGrpcMessageTooLarge() {
78437843 ts .NoError (run .Get (ctx , nil ))
78447844 _ , err = ts .client .QueryWorkflow (ctx , run .GetID (), run .GetRunID (), "too-large-query" , false )
78457845 ts .Error (err )
7846- ts .Contains (err .Error (), "grpc: received message larger than max" )
7846+ ts .Contains (err .Error (), "message larger than max" )
78477847 })
78487848}
0 commit comments