hs-test: set longer timeouts while debugging
Type: test Change-Id: I87baba7efa36dd40f086523b35bc6d3b0a26a1b5 Signed-off-by: Adrian Villin <avillin@cisco.com>
This commit is contained in:

committed by
Florin Coras

parent
b9464cde7d
commit
93974e281e
@ -2,12 +2,21 @@ package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var suiteTimeout time.Duration
|
||||
|
||||
func TestHst(t *testing.T) {
|
||||
if *isVppDebug {
|
||||
// 30 minute timeout so that the framework won't timeout while debugging
|
||||
suiteTimeout = time.Minute * 30
|
||||
} else {
|
||||
suiteTimeout = time.Minute * 5
|
||||
}
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "HST")
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
)
|
||||
@ -101,7 +100,7 @@ var _ = Describe("NginxSuite", Ordered, ContinueOnFailure, func() {
|
||||
It(testName, func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
||||
@ -128,6 +127,6 @@ var _ = Describe("NginxSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
|
||||
It(testName, Label("SOLO"), func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
)
|
||||
@ -77,7 +76,7 @@ var _ = Describe("NoTopoSuite", Ordered, ContinueOnFailure, func() {
|
||||
It(testName, func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
||||
@ -104,6 +103,6 @@ var _ = Describe("NoTopoSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
|
||||
It(testName, Label("SOLO"), func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
)
|
||||
@ -86,7 +85,7 @@ var _ = Describe("NsSuite", Ordered, ContinueOnFailure, func() {
|
||||
It(testName, func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
||||
@ -113,6 +112,6 @@ var _ = Describe("NsSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
|
||||
It(testName, Label("SOLO"), func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
@ -52,7 +52,7 @@ var _ = Describe("TapSuite", Ordered, ContinueOnFailure, func() {
|
||||
It(testName, func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
||||
@ -79,6 +79,6 @@ var _ = Describe("TapSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
|
||||
It(testName, Label("SOLO"), func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
@ -109,7 +109,7 @@ var _ = Describe("VethsSuite", Ordered, ContinueOnFailure, func() {
|
||||
It(testName, func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
||||
@ -137,6 +137,6 @@ var _ = Describe("VethsSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
|
||||
It(testName, Label("SOLO"), func(ctx SpecContext) {
|
||||
s.log(testName + ": BEGIN")
|
||||
test(&s)
|
||||
}, SpecTimeout(time.Minute*5))
|
||||
}, SpecTimeout(suiteTimeout))
|
||||
}
|
||||
})
|
||||
|
@ -108,6 +108,7 @@ func (vpp *VppInstance) getEtcDir() string {
|
||||
}
|
||||
|
||||
func (vpp *VppInstance) start() error {
|
||||
maxReconnectAttempts := 3
|
||||
// Replace default logger in govpp with our own
|
||||
govppLogger := logrus.New()
|
||||
govppLogger.SetOutput(io.MultiWriter(vpp.getSuite().logger.Writer(), GinkgoWriter))
|
||||
@ -142,6 +143,8 @@ func (vpp *VppInstance) start() error {
|
||||
|
||||
vpp.getSuite().log("starting vpp")
|
||||
if *isVppDebug {
|
||||
// default = 3; VPP will timeout while debugging if there are not enough attempts
|
||||
maxReconnectAttempts = 5000
|
||||
sig := make(chan os.Signal, 1)
|
||||
signal.Notify(sig, syscall.SIGQUIT)
|
||||
cont := make(chan bool, 1)
|
||||
@ -166,7 +169,7 @@ func (vpp *VppInstance) start() error {
|
||||
sockAddress := vpp.container.getHostWorkDir() + defaultApiSocketFilePath
|
||||
conn, connEv, err := govpp.AsyncConnect(
|
||||
sockAddress,
|
||||
core.DefaultMaxReconnectAttempts,
|
||||
maxReconnectAttempts,
|
||||
core.DefaultReconnectInterval)
|
||||
if err != nil {
|
||||
vpp.getSuite().log("async connect error: " + fmt.Sprint(err))
|
||||
@ -184,7 +187,7 @@ func (vpp *VppInstance) start() error {
|
||||
context.Background(),
|
||||
core.WithRequestSize(50),
|
||||
core.WithReplySize(50),
|
||||
core.WithReplyTimeout(time.Second*10))
|
||||
core.WithReplyTimeout(time.Second*5))
|
||||
if err != nil {
|
||||
vpp.getSuite().log("creating stream failed: " + fmt.Sprint(err))
|
||||
return err
|
||||
|
Reference in New Issue
Block a user