diff options
author | Adrian Villin <avillin@cisco.com> | 2024-05-30 06:10:59 -0400 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2024-05-30 15:59:01 +0000 |
commit | 93974e281e7f99309af259c615f7068dee600114 (patch) | |
tree | fcc533b653259bdeb9d2c3c23f914aa559729650 /extras/hs-test | |
parent | b9464cde7d3288f8feeeaf945ce933b276f07d82 (diff) |
hs-test: set longer timeouts while debugging
Type: test
Change-Id: I87baba7efa36dd40f086523b35bc6d3b0a26a1b5
Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test')
-rw-r--r-- | extras/hs-test/framework_test.go | 9 | ||||
-rw-r--r-- | extras/hs-test/suite_nginx_test.go | 5 | ||||
-rw-r--r-- | extras/hs-test/suite_no_topo_test.go | 5 | ||||
-rw-r--r-- | extras/hs-test/suite_ns_test.go | 5 | ||||
-rw-r--r-- | extras/hs-test/suite_tap_test.go | 4 | ||||
-rw-r--r-- | extras/hs-test/suite_veth_test.go | 4 | ||||
-rw-r--r-- | extras/hs-test/vppinstance.go | 7 |
7 files changed, 24 insertions, 15 deletions
diff --git a/extras/hs-test/framework_test.go b/extras/hs-test/framework_test.go index 8773fa2417d..8cbf936f026 100644 --- a/extras/hs-test/framework_test.go +++ b/extras/hs-test/framework_test.go @@ -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") } diff --git a/extras/hs-test/suite_nginx_test.go b/extras/hs-test/suite_nginx_test.go index ef4ca5c4ae4..4c6e9dbb309 100644 --- a/extras/hs-test/suite_nginx_test.go +++ b/extras/hs-test/suite_nginx_test.go @@ -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)) } }) diff --git a/extras/hs-test/suite_no_topo_test.go b/extras/hs-test/suite_no_topo_test.go index 19a3e1fd288..260fc1d681d 100644 --- a/extras/hs-test/suite_no_topo_test.go +++ b/extras/hs-test/suite_no_topo_test.go @@ -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)) } }) diff --git a/extras/hs-test/suite_ns_test.go b/extras/hs-test/suite_ns_test.go index 377046cdaeb..7bdb90b42ae 100644 --- a/extras/hs-test/suite_ns_test.go +++ b/extras/hs-test/suite_ns_test.go @@ -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)) } }) diff --git a/extras/hs-test/suite_tap_test.go b/extras/hs-test/suite_tap_test.go index ebf0f9b3cbc..cb0653304c3 100644 --- a/extras/hs-test/suite_tap_test.go +++ b/extras/hs-test/suite_tap_test.go @@ -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)) } }) diff --git a/extras/hs-test/suite_veth_test.go b/extras/hs-test/suite_veth_test.go index c3038ca3727..13ef5ef268d 100644 --- a/extras/hs-test/suite_veth_test.go +++ b/extras/hs-test/suite_veth_test.go @@ -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)) } }) diff --git a/extras/hs-test/vppinstance.go b/extras/hs-test/vppinstance.go index 3276c2dd9ae..8a92776894c 100644 --- a/extras/hs-test/vppinstance.go +++ b/extras/hs-test/vppinstance.go @@ -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 |