Browse code

Run TestImportExtremelyLargeImageWorks in parallel

This is a slow test, taking over two minutes to complete,
so spin up a new daemon for this test and run it in parallel

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/01/03 20:09:24
Showing 1 changed files
... ...
@@ -9,17 +9,24 @@ import (
9 9
 	"testing"
10 10
 
11 11
 	"github.com/docker/docker/api/types"
12
+	"github.com/docker/docker/internal/test/daemon"
12 13
 	"github.com/docker/docker/internal/testutil"
13 14
 	"gotest.tools/skip"
14 15
 )
15 16
 
16 17
 // Ensure we don't regress on CVE-2017-14992.
17 18
 func TestImportExtremelyLargeImageWorks(t *testing.T) {
19
+	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
18 20
 	skip.If(t, runtime.GOARCH == "arm64", "effective test will be time out")
19 21
 	skip.If(t, testEnv.OSType == "windows", "TODO enable on windows")
22
+	t.Parallel()
20 23
 
21
-	defer setupTest(t)()
22
-	client := testEnv.APIClient()
24
+	// Spin up a new daemon, so that we can run this test in parallel (it's a slow test)
25
+	d := daemon.New(t)
26
+	d.Start(t)
27
+	defer d.Stop(t)
28
+
29
+	client := d.NewClientT(t)
23 30
 
24 31
 	// Construct an empty tar archive with about 8GB of junk padding at the
25 32
 	// end. This should not cause any crashes (the padding should be mostly