Browse Source

Windows: disable flaky test TestStartReturnCorrectExitCode

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Andrew Hsu 5 years ago
parent
commit
1be272ef76
1 changed files with 15 additions and 0 deletions
  1. 15 0
      integration-cli/docker_cli_start_test.go

+ 15 - 0
integration-cli/docker_cli_start_test.go

@@ -2,11 +2,14 @@ package main
 
 
 import (
 import (
 	"fmt"
 	"fmt"
+	"runtime"
+	"strconv"
 	"strings"
 	"strings"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
+	"github.com/docker/docker/pkg/parsers/kernel"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
@@ -186,6 +189,18 @@ func (s *DockerSuite) TestStartAttachWithRename(c *testing.T) {
 }
 }
 
 
 func (s *DockerSuite) TestStartReturnCorrectExitCode(c *testing.T) {
 func (s *DockerSuite) TestStartReturnCorrectExitCode(c *testing.T) {
+	// Note we parse kernel.GetKernelVersion rather than system.GetOSVersion
+	// as test binaries aren't manifested, so would otherwise report the wrong
+	// build number.
+	if runtime.GOOS == "windows" {
+		v, err := kernel.GetKernelVersion()
+		assert.NilError(c, err)
+		build, _ := strconv.Atoi(strings.Split(strings.SplitN(v.String(), " ", 3)[2][1:], ".")[0])
+		if build < 16299 {
+			c.Skip("FLAKY on Windows RS1, see #38521")
+		}
+	}
+
 	dockerCmd(c, "create", "--restart=on-failure:2", "--name", "withRestart", "busybox", "sh", "-c", "exit 11")
 	dockerCmd(c, "create", "--restart=on-failure:2", "--name", "withRestart", "busybox", "sh", "-c", "exit 11")
 	dockerCmd(c, "create", "--rm", "--name", "withRm", "busybox", "sh", "-c", "exit 12")
 	dockerCmd(c, "create", "--rm", "--name", "withRm", "busybox", "sh", "-c", "exit 12")