fix: flaky integration tests

This commit is contained in:
Ludovic Fernandez 2020-10-09 09:32:03 +02:00 committed by GitHub
parent d2435cf43b
commit 5c853766e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 160 additions and 150 deletions

View file

@ -13,6 +13,7 @@ import (
"strings"
"testing"
"text/template"
"time"
"github.com/fatih/structs"
"github.com/go-check/check"
@ -120,6 +121,15 @@ func (s *BaseSuite) cmdTraefik(args ...string) (*exec.Cmd, *bytes.Buffer) {
return cmd, &out
}
func (s *BaseSuite) killCmd(cmd *exec.Cmd) {
err := cmd.Process.Kill()
if err != nil {
log.WithoutContext().Errorf("Kill: %v", err)
}
time.Sleep(100 * time.Millisecond)
}
func (s *BaseSuite) traefikCmd(args ...string) (*exec.Cmd, func(*check.C)) {
cmd, out := s.cmdTraefik(args...)
return cmd, func(c *check.C) {