Skip to content

Commit

Permalink
test: Increase timeout for privileged unit tests
Browse files Browse the repository at this point in the history
The default timeout is 4 minutes, but the privileged unit tests
sometimes take longer.

Signed-off-by: Paul Chaignon <paul@cilium.io>
  • Loading branch information
pchaigno authored and aanm committed May 25, 2020
1 parent 52bb8f3 commit c42b879
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/runtime/privileged_tests.go
Expand Up @@ -15,15 +15,23 @@
package RuntimeTest

import (
"context"
"fmt"
"path/filepath"
"time"

. "github.com/cilium/cilium/test/ginkgo-ext"
"github.com/cilium/cilium/test/helpers"

. "github.com/onsi/gomega"
)

const (
// The privileged unit tests can take more than 4 minutes, the default
// timeout for helper commands.
privilegedUnitTestTimeout = 8 * time.Minute
)

var _ = Describe("RuntimePrivilegedUnitTests", func() {

var vm *helpers.SSHMeta
Expand All @@ -43,7 +51,9 @@ var _ = Describe("RuntimePrivilegedUnitTests", func() {

It("Run Tests", func() {
path, _ := filepath.Split(vm.BasePath())
res := vm.ExecWithSudo(fmt.Sprintf("make -C %s tests-privileged", path))
ctx, cancel := context.WithTimeout(context.Background(), privilegedUnitTestTimeout)
defer cancel()
res := vm.ExecContext(ctx, fmt.Sprintf("sudo make -C %s tests-privileged", path))
res.ExpectSuccess("Failed to run privileged unit tests")
})
})

0 comments on commit c42b879

Please sign in to comment.