hs-test: set longer timeouts while debugging 57/40957/2
authorAdrian Villin <[email protected]>
Thu, 30 May 2024 10:10:59 +0000 (06:10 -0400)
committerFlorin Coras <[email protected]>
Thu, 30 May 2024 15:59:01 +0000 (15:59 +0000)
Type: test

Change-Id: I87baba7efa36dd40f086523b35bc6d3b0a26a1b5
Signed-off-by: Adrian Villin <[email protected]>
extras/hs-test/framework_test.go
extras/hs-test/suite_nginx_test.go
extras/hs-test/suite_no_topo_test.go
extras/hs-test/suite_ns_test.go
extras/hs-test/suite_tap_test.go
extras/hs-test/suite_veth_test.go
extras/hs-test/vppinstance.go

index 8773fa2..8cbf936 100644 (file)
@@ -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")
 }
index ef4ca5c..4c6e9db 100644 (file)
@@ -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))
        }
 })
index 19a3e1f..260fc1d 100644 (file)
@@ -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))
        }
 })
index 377046c..7bdb90b 100644 (file)
@@ -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))
        }
 })
index ebf0f9b..cb06533 100644 (file)
@@ -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))
        }
 })
index c3038ca..13ef5ef 100644 (file)
@@ -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))
        }
 })
index 3276c2d..8a92776 100644 (file)
@@ -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