@@ -60,38 +60,39 @@ func TestMutableStateImpl_ForceFlushBufferedEvents(t *testing.T) {
6060
6161 for _ , tc := range []mutationTestCase {
6262 {
63- name : "Number of events acceptable " ,
63+ name : "Number of events ok " ,
6464 transactionPolicy : workflow .TransactionPolicyActive ,
65- signals : 1 ,
65+ signals : 2 ,
6666 maxEvents : 2 ,
6767 maxSizeInBytes : math .MaxInt ,
6868 expectFlush : false ,
6969 },
7070 {
71- name : "Number of events has reached limit " ,
71+ name : "Max number of events exceeded " ,
7272 transactionPolicy : workflow .TransactionPolicyActive ,
73- signals : 2 ,
73+ signals : 3 ,
7474 maxEvents : 2 ,
7575 maxSizeInBytes : math .MaxInt ,
7676 expectFlush : true ,
7777 },
7878 {
79- name : "Number of events acceptable but byte size limit exceeded" ,
79+ name : "Number of events ok but byte size limit exceeded" ,
8080 transactionPolicy : workflow .TransactionPolicyActive ,
81- signals : 1 ,
81+ signals : 2 ,
8282 maxEvents : 2 ,
83- maxSizeInBytes : 0 ,
83+ maxSizeInBytes : 25 ,
8484 expectFlush : true ,
8585 },
8686 {
87- name : "Number of events limit reached and byte size limit exceeded" ,
87+ name : "Max number of events and size of events both exceeded" ,
8888 transactionPolicy : workflow .TransactionPolicyActive ,
89- signals : 2 ,
89+ signals : 3 ,
9090 maxEvents : 2 ,
91- maxSizeInBytes : 0 ,
91+ maxSizeInBytes : 25 ,
9292 expectFlush : true ,
9393 },
9494 } {
95+ tc := tc
9596 t .Run (tc .name , tc .Run )
9697 }
9798}
@@ -105,7 +106,7 @@ type mutationTestCase struct {
105106 maxSizeInBytes int
106107}
107108
108- func (c mutationTestCase ) Run (t * testing.T ) {
109+ func (c * mutationTestCase ) Run (t * testing.T ) {
109110 t .Parallel ()
110111
111112 nsEntry := tests .LocalNamespaceEntry
@@ -131,7 +132,7 @@ func (c mutationTestCase) Run(t *testing.T) {
131132 }
132133}
133134
134- func (c mutationTestCase ) startWFT (
135+ func (c * mutationTestCase ) startWFT (
135136 t * testing.T ,
136137 ms * workflow.MutableStateImpl ,
137138) * workflow.WorkflowTaskInfo {
@@ -150,7 +151,7 @@ func (c mutationTestCase) startWFT(
150151 return wft
151152}
152153
153- func (c mutationTestCase ) startWorkflowExecution (
154+ func (c * mutationTestCase ) startWorkflowExecution (
154155 t * testing.T ,
155156 ms * workflow.MutableStateImpl ,
156157 nsEntry * namespace.Namespace ,
@@ -178,7 +179,7 @@ func (c mutationTestCase) startWorkflowExecution(
178179 }
179180}
180181
181- func (c mutationTestCase ) addWorkflowExecutionSignaled (t * testing.T , i int , ms * workflow.MutableStateImpl ) {
182+ func (c * mutationTestCase ) addWorkflowExecutionSignaled (t * testing.T , i int , ms * workflow.MutableStateImpl ) {
182183 t .Helper ()
183184
184185 payload := & commonpb.Payloads {}
@@ -197,7 +198,7 @@ func (c mutationTestCase) addWorkflowExecutionSignaled(t *testing.T, i int, ms *
197198 }
198199}
199200
200- func (c mutationTestCase ) createMutableState (t * testing.T , nsEntry * namespace.Namespace ) * workflow.MutableStateImpl {
201+ func (c * mutationTestCase ) createMutableState (t * testing.T , nsEntry * namespace.Namespace ) * workflow.MutableStateImpl {
201202 t .Helper ()
202203
203204 ctrl := gomock .NewController (t )
@@ -236,23 +237,23 @@ func (c mutationTestCase) createMutableState(t *testing.T, nsEntry *namespace.Na
236237 return ms
237238}
238239
239- func (c mutationTestCase ) createConfig () * configs.Config {
240+ func (c * mutationTestCase ) createConfig () * configs.Config {
240241 cfg := tests .NewDynamicConfig ()
241242 cfg .MaximumBufferedEventsBatch = c .getMaxEvents
242243 cfg .MaximumBufferedEventsSizeInBytes = c .getMaxSizeInBytes
243244
244245 return cfg
245246}
246247
247- func (c mutationTestCase ) getMaxEvents () int {
248+ func (c * mutationTestCase ) getMaxEvents () int {
248249 return c .maxEvents
249250}
250251
251- func (c mutationTestCase ) getMaxSizeInBytes () int {
252+ func (c * mutationTestCase ) getMaxSizeInBytes () int {
252253 return c .maxSizeInBytes
253254}
254255
255- func (c mutationTestCase ) testWFTFailedEvent (
256+ func (c * mutationTestCase ) testWFTFailedEvent (
256257 t * testing.T ,
257258 wft * workflow.WorkflowTaskInfo ,
258259 event * history.HistoryEvent ,
@@ -276,7 +277,7 @@ func (c mutationTestCase) testWFTFailedEvent(
276277 }
277278}
278279
279- func (c mutationTestCase ) findWFTEvent (eventType enumspb.EventType , workflowEvents []* persistence.WorkflowEvents ) (
280+ func (c * mutationTestCase ) findWFTEvent (eventType enumspb.EventType , workflowEvents []* persistence.WorkflowEvents ) (
280281 * history.HistoryEvent ,
281282 bool ,
282283) {
@@ -291,7 +292,7 @@ func (c mutationTestCase) findWFTEvent(eventType enumspb.EventType, workflowEven
291292 return nil , false
292293}
293294
294- func (c mutationTestCase ) testFailure (
295+ func (c * mutationTestCase ) testFailure (
295296 t * testing.T ,
296297 ms * workflow.MutableStateImpl ,
297298 wft * workflow.WorkflowTaskInfo ,
@@ -330,7 +331,7 @@ func (c mutationTestCase) testFailure(
330331 c .testWFTFailedEvent (t , wft , event )
331332}
332333
333- func (c mutationTestCase ) testSuccess (
334+ func (c * mutationTestCase ) testSuccess (
334335 t * testing.T ,
335336 ms * workflow.MutableStateImpl ,
336337 workflowEvents []* persistence.WorkflowEvents ,
0 commit comments