@@ -1535,15 +1535,12 @@ func TestSendRecv(t *testing.T) {
15351535 // Verify step counting for receive workflow (receiveWorkflow calls Recv 3 times)
15361536 receiveSteps , err := GetWorkflowSteps (dbosCtx , receiveHandle .GetWorkflowID ())
15371537 require .NoError (t , err , "failed to get workflow steps for receive workflow" )
1538- require .Len (t , receiveSteps , 6 , "expected 4 steps in receive workflow (3 Recv calls + 1 sleep call during the first recv), got %d" , len (receiveSteps ))
1539- for i , step := range receiveSteps {
1540- require .Equal (t , i , step .StepID , "expected step %d to have correct StepID" , i )
1541- if i % 2 == 1 {
1542- require .Equal (t , "DBOS.sleep" , step .StepName , "expected step %d to have StepName 'DBOS.sleep'" , i )
1543- } else {
1544- require .Equal (t , "DBOS.recv" , step .StepName , "expected step %d to have StepName 'DBOS.recv'" , i )
1545- }
1546- }
1538+ require .Len (t , receiveSteps , 4 , "expected 4 steps in receive workflow (3 Recv calls + 1 sleep call during the first recv), got %d" , len (receiveSteps ))
1539+ // Steps 0, 2 and 4 are recv
1540+ require .Equal (t , "DBOS.recv" , receiveSteps [0 ].StepName , "expected step 0 to have StepName 'DBOS.recv'" )
1541+ require .Equal (t , "DBOS.sleep" , receiveSteps [1 ].StepName , "expected step 1 to have StepName 'DBOS.sleep'" )
1542+ require .Equal (t , "DBOS.recv" , receiveSteps [2 ].StepName , "expected step 2 to have StepName 'DBOS.recv'" )
1543+ require .Equal (t , "DBOS.recv" , receiveSteps [3 ].StepName , "expected step 3 to have StepName 'DBOS.recv'" )
15471544 })
15481545
15491546 t .Run ("SendRecvCustomStruct" , func (t * testing.T ) {
@@ -1654,15 +1651,13 @@ func TestSendRecv(t *testing.T) {
16541651 // Verify step counting for receive workflow (calls Recv 3 times, each with sleep)
16551652 receiveSteps , err := GetWorkflowSteps (dbosCtx , receiveHandle .GetWorkflowID ())
16561653 require .NoError (t , err , "failed to get workflow steps for receive workflow" )
1657- require .Len (t , receiveSteps , 6 , "expected 4 steps in receive workflow (3 Recv calls + 1 sleep calls), got %d" , len (receiveSteps ))
1658- for i , step := range receiveSteps {
1659- require .Equal (t , i , step .StepID , "expected step %d to have correct StepID" , i )
1660- if i % 2 == 1 {
1661- require .Equal (t , "DBOS.sleep" , step .StepName , "expected recv step %d to have StepName 'DBOS.sleep'" , i )
1662- } else {
1663- require .Equal (t , "DBOS.recv" , step .StepName , "expected recv step %d to have StepName 'DBOS.recv'" , i )
1664- }
1665- }
1654+ require .Len (t , receiveSteps , 4 , "expected 4 steps in receive workflow (3 Recv calls + 1 sleep calls), got %d" , len (receiveSteps ))
1655+ // Steps 0, 2 and 4 are recv
1656+ require .Equal (t , "DBOS.recv" , receiveSteps [0 ].StepName , "expected step 0 to have StepName 'DBOS.recv'" )
1657+ require .Equal (t , "DBOS.sleep" , receiveSteps [1 ].StepName , "expected step 1 to have StepName 'DBOS.sleep'" )
1658+ require .Equal (t , "DBOS.recv" , receiveSteps [2 ].StepName , "expected step 2 to have StepName 'DBOS.recv'" )
1659+ require .Equal (t , "DBOS.recv" , receiveSteps [3 ].StepName , "expected step 3 to have StepName 'DBOS.recv'" )
1660+
16661661 })
16671662 t .Run ("SendRecvIdempotency" , func (t * testing.T ) {
16681663 // Start the receive workflow and wait for it to be ready
0 commit comments