Browse Source

revert: undo request timeout test sleep operation

pull/222/head
liulei 4 years ago
parent
commit
be45d1d530
  1. 6
      dtmsvr/trans_type_saga.go
  2. 3
      test/busi/base_http.go

6
dtmsvr/trans_type_saga.go

@ -170,10 +170,6 @@ func (t *transSagaProcessor) ProcessOnce(branches []TransBranch) error {
}
}
waitDoneOnce := func() {
timeAfter := time.Second * 3
if t.RequestTimeout != 0 {
timeAfter = time.Duration(t.RequestTimeout) * time.Second
}
select {
case r := <-resultChan:
br := &branchResults[r.index]
@ -192,7 +188,7 @@ func (t *transSagaProcessor) ProcessOnce(branches []TransBranch) error {
}
}
logger.Debugf("branch done: %v", r)
case <-time.After(timeAfter):
case <-time.After(time.Second * 3):
logger.Debugf("wait once for done")
}
}

3
test/busi/base_http.go

@ -10,8 +10,6 @@ import (
"database/sql"
"errors"
"fmt"
"time"
"github.com/dtm-labs/dtm/dtmcli"
"github.com/dtm-labs/dtm/dtmcli/dtmimp"
"github.com/dtm-labs/dtm/dtmcli/logger"
@ -154,7 +152,6 @@ func BaseAddRoute(app *gin.Engine) {
})
}))
app.POST(BusiAPI+"/TransOutTimeout", dtmutil.WrapHandler2(func(c *gin.Context) interface{} {
time.Sleep(time.Second * 4)
return handleGeneralBusiness(c, MainSwitch.TransOutResult.Fetch(), reqFrom(c).TransOutResult, "TransOut")
}))
app.POST(BusiAPI+"/TransInTccNested", dtmutil.WrapHandler2(func(c *gin.Context) interface{} {

Loading…
Cancel
Save