Skip to content

Commit eb9560b

Browse files
committed
config/engine: distinct startContainerTimouts for windows/linux
Test the start container time cost on windows instances with various parameters (instance type, container memory, container cpu, etc.), and set the default startContainerTimeouts value for windows accordingly. Also make the startContainerTimeouts configurable (via ECS_CONTAINER_START_TIMEOUT environment variable) by users.
1 parent d5fa92a commit eb9560b

23 files changed

+138
-46
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## 1.17.3-dev
4+
* Enhancement - Distinct startContainerTimeouts for windows/linux, introduce a new environment variable `ECS_CONTAINER_START_TIMEOUT` to make it configurable [#1321](https://github.com/aws/amazon-ecs-agent/pull/1321)
45
* Enhancement - Add support for containers to inhereit ENI private DNS hostnames for `awsvpc` tasks [#1278](https://github.com/aws/amazon-ecs-agent/pull/1278)
56
* Enhancement - Expose task definition family and task definition revision in container metadata file [#1295](https://github.com/aws/amazon-ecs-agent/pull/1295)
67
* Enhancement - Fail image pulls if there's inactivity during image pull progress [#1290](https://github.com/aws/amazon-ecs-agent/pull/1290)

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ additional details on each available environment variable.
162162
| `ECS_APPARMOR_CAPABLE` | `true` | Whether AppArmor is available on the container instance. | `false` | `false` |
163163
| `ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION` | 10m | Time to wait to delete containers for a stopped task. If set to less than 1 minute, the value is ignored. | 3h | 3h |
164164
| `ECS_CONTAINER_STOP_TIMEOUT` | 10m | Time to wait for the container to exit normally before being forcibly killed. | 30s | 30s |
165+
| `ECS_CONTAINER_START_TIMEOUT` | 10m | Timeout before giving up on starting a container. | 3m | 8m |
165166
| `ECS_ENABLE_TASK_IAM_ROLE` | `true` | Whether to enable IAM Roles for Tasks on the Container Instance | `false` | `false` |
166167
| `ECS_ENABLE_TASK_IAM_ROLE_NETWORK_HOST` | `true` | Whether to enable IAM Roles for Tasks when launched with `host` network mode on the Container Instance | `false` | `false` |
167168
| `ECS_DISABLE_IMAGE_CLEANUP` | `true` | Whether to disable automated image cleanup for the ECS Agent. | `false` | `false` |

agent/config/config.go

+34-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const (
5555
// clean up task's containers.
5656
DefaultTaskCleanupWaitDuration = 3 * time.Hour
5757

58-
// DefaultDockerStopTimeout specifies the value for container stop timeout duration
59-
DefaultDockerStopTimeout = 30 * time.Second
58+
// defaultDockerStopTimeout specifies the value for container stop timeout duration
59+
defaultDockerStopTimeout = 30 * time.Second
6060

6161
// DefaultImageCleanupTimeInterval specifies the default value for image cleanup duration. It is used to
6262
// remove the images pulled by agent.
@@ -288,6 +288,8 @@ func environmentConfig() (Config, error) {
288288

289289
dockerStopTimeout := getDockerStopTimeout()
290290

291+
containerStartTimeout := getContainerStartTimeout()
292+
291293
cgroupPath := os.Getenv("ECS_CGROUP_PATH")
292294

293295
taskCleanupWaitDuration := parseEnvVariableDuration("ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION")
@@ -385,6 +387,7 @@ func environmentConfig() (Config, error) {
385387
TaskIAMRoleEnabled: taskIAMRoleEnabled,
386388
TaskCPUMemLimit: taskCPUMemLimitEnabled,
387389
DockerStopTimeout: dockerStopTimeout,
390+
ContainerStartTimeout: containerStartTimeout,
388391
CredentialsAuditLogFile: credentialsAuditLogFile,
389392
CredentialsAuditLogDisabled: credentialsAuditLogDisabled,
390393
TaskIAMRoleEnabledForNetworkHost: taskIAMRoleEnabledForNetworkHost,
@@ -423,12 +426,34 @@ func getDockerStopTimeout() time.Duration {
423426
parsedStopTimeout := parseEnvVariableDuration("ECS_CONTAINER_STOP_TIMEOUT")
424427
if parsedStopTimeout >= minimumDockerStopTimeout {
425428
dockerStopTimeout = parsedStopTimeout
429+
// if the ECS_CONTAINER_STOP_TIMEOUT is invalid or empty, then the parsedStopTimeout
430+
// will be 0, in this case we should return a 0,
431+
// because the DockerStopTimeout will merge with the DefaultDockerStopTimeout,
432+
// only when the DockerStopTimeout is empty
426433
} else if parsedStopTimeout != 0 {
434+
// if the configured ECS_CONTAINER_STOP_TIMEOUT is smaller than minimumDockerStopTimeout,
435+
// DockerStopTimeout will be set to minimumDockerStopTimeout
436+
// if the ECS_CONTAINER_STOP_TIMEOUT is 0, empty or an invalid value, then DockerStopTimeout
437+
// will be set to defaultDockerStopTimeout during the config merge operation
438+
dockerStopTimeout = minimumDockerStopTimeout
427439
seelog.Warnf("Discarded invalid value for docker stop timeout, parsed as: %v", parsedStopTimeout)
428440
}
429441
return dockerStopTimeout
430442
}
431443

444+
func getContainerStartTimeout() time.Duration {
445+
var containerStartTimeout time.Duration
446+
parsedStartTimeout := parseEnvVariableDuration("ECS_CONTAINER_START_TIMEOUT")
447+
if parsedStartTimeout >= minimumContainerStartTimeout {
448+
containerStartTimeout = parsedStartTimeout
449+
// do the parsedStartTimeout != 0 check for the same reason as in getDockerStopTimeout()
450+
} else if parsedStartTimeout != 0 {
451+
containerStartTimeout = minimumContainerStartTimeout
452+
seelog.Warnf("Discarded invalid value for container start timeout, parsed as: %v", parsedStartTimeout)
453+
}
454+
return containerStartTimeout
455+
}
456+
432457
func getTaskCPUMemLimitEnabled() Conditional {
433458
var taskCPUMemLimitEnabled Conditional
434459
taskCPUMemLimitConfigString := os.Getenv("ECS_ENABLE_TASK_CPU_MEM_LIMIT")
@@ -563,7 +588,11 @@ func (cfg *Config) validateAndOverrideBounds() error {
563588
}
564589

565590
if cfg.DockerStopTimeout < minimumDockerStopTimeout {
566-
return fmt.Errorf("Invalid negative DockerStopTimeout: %v", cfg.DockerStopTimeout.String())
591+
return fmt.Errorf("config: invalid value for docker container stop timeout: %v", cfg.DockerStopTimeout.String())
592+
}
593+
594+
if cfg.ContainerStartTimeout < minimumContainerStartTimeout {
595+
return fmt.Errorf("config: invalid value for docker container start timeout: %v", cfg.ContainerStartTimeout.String())
567596
}
568597
var badDrivers []string
569598
for _, driver := range cfg.AvailableLoggingDrivers {
@@ -618,6 +647,7 @@ func (cfg *Config) String() string {
618647
"ReservedMem: %v, "+
619648
"TaskCleanupWaitDuration: %v, "+
620649
"DockerStopTimeout: %v, "+
650+
"ContainerStartTimeout: %v, "+
621651
"TaskCPUMemLimit: %v, "+
622652
"%s",
623653
cfg.Cluster,
@@ -630,6 +660,7 @@ func (cfg *Config) String() string {
630660
cfg.ReservedMemory,
631661
cfg.TaskCleanupWaitDuration,
632662
cfg.DockerStopTimeout,
663+
cfg.ContainerStartTimeout,
633664
cfg.TaskCPUMemLimit,
634665
cfg.platformString(),
635666
)

agent/config/config_test.go

+53-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
// Copyright 2014-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License"). You may
44
// not use this file except in compliance with the License. A copy of the
@@ -69,6 +69,7 @@ func TestEnvironmentConfig(t *testing.T) {
6969
defer setTestEnv("ECS_RESERVED_PORTS_UDP", "[42,99]")()
7070
defer setTestEnv("ECS_RESERVED_MEMORY", "20")()
7171
defer setTestEnv("ECS_CONTAINER_STOP_TIMEOUT", "60s")()
72+
defer setTestEnv("ECS_CONTAINER_START_TIMEOUT", "5m")()
7273
defer setTestEnv("ECS_AVAILABLE_LOGGING_DRIVERS", "[\""+string(dockerclient.SyslogDriver)+"\"]")()
7374
defer setTestEnv("ECS_SELINUX_CAPABLE", "true")()
7475
defer setTestEnv("ECS_APPARMOR_CAPABLE", "true")()
@@ -95,8 +96,10 @@ func TestEnvironmentConfig(t *testing.T) {
9596
assert.Contains(t, conf.ReservedPortsUDP, uint16(42))
9697
assert.Contains(t, conf.ReservedPortsUDP, uint16(99))
9798
assert.Equal(t, uint16(20), conf.ReservedMemory)
98-
expectedDuration, _ := time.ParseDuration("60s")
99-
assert.Equal(t, expectedDuration, conf.DockerStopTimeout)
99+
expectedDurationDockerStopTimeout, _ := time.ParseDuration("60s")
100+
assert.Equal(t, expectedDurationDockerStopTimeout, conf.DockerStopTimeout)
101+
expectedDurationContainerStartTimeout, _ := time.ParseDuration("5m")
102+
assert.Equal(t, expectedDurationContainerStartTimeout, conf.ContainerStartTimeout)
100103
assert.Equal(t, []dockerclient.LoggingDriver{dockerclient.SyslogDriver}, conf.AvailableLoggingDrivers)
101104
assert.True(t, conf.PrivilegedDisabled)
102105
assert.True(t, conf.SELinuxCapable, "Wrong value for SELinuxCapable")
@@ -195,23 +198,61 @@ func TestCheckpointWithoutECSDataDir(t *testing.T) {
195198
func TestInvalidFormatDockerStopTimeout(t *testing.T) {
196199
defer setTestRegion()()
197200
defer setTestEnv("ECS_CONTAINER_STOP_TIMEOUT", "invalid")()
198-
conf, err := environmentConfig()
201+
ctrl := gomock.NewController(t)
202+
mockEc2Metadata := mock_ec2.NewMockEC2MetadataClient(ctrl)
203+
conf, err := NewConfig(mockEc2Metadata)
199204
assert.NoError(t, err)
200-
assert.Zero(t, conf.DockerStopTimeout, "Wrong value for DockerStopTimeout")
205+
assert.Equal(t, conf.DockerStopTimeout, defaultDockerStopTimeout, "Wrong value for DockerStopTimeout")
201206
}
202207

203-
func TestInvalideValueDockerStopTimeout(t *testing.T) {
208+
func TestZeroValueDockerStopTimeout(t *testing.T) {
209+
defer setTestRegion()()
210+
defer setTestEnv("ECS_CONTAINER_STOP_TIMEOUT", "0s")()
211+
ctrl := gomock.NewController(t)
212+
mockEc2Metadata := mock_ec2.NewMockEC2MetadataClient(ctrl)
213+
conf, err := NewConfig(mockEc2Metadata)
214+
assert.NoError(t, err)
215+
assert.Equal(t, conf.DockerStopTimeout, defaultDockerStopTimeout, "Wrong value for DockerStopTimeout")
216+
}
217+
218+
func TestInvalidValueDockerStopTimeout(t *testing.T) {
204219
defer setTestRegion()()
205220
defer setTestEnv("ECS_CONTAINER_STOP_TIMEOUT", "-10s")()
206-
conf, err := environmentConfig()
221+
ctrl := gomock.NewController(t)
222+
mockEc2Metadata := mock_ec2.NewMockEC2MetadataClient(ctrl)
223+
conf, err := NewConfig(mockEc2Metadata)
207224
assert.NoError(t, err)
208-
assert.Zero(t, conf.DockerStopTimeout)
225+
assert.Equal(t, conf.DockerStopTimeout, minimumDockerStopTimeout, "Wrong value for DockerStopTimeout")
209226
}
210227

211-
func TestInvalidDockerStopTimeout(t *testing.T) {
212-
conf := DefaultConfig()
213-
conf.DockerStopTimeout = -1 * time.Second
214-
assert.Error(t, conf.validateAndOverrideBounds(), "Should be error with negative DockerStopTimeout")
228+
func TestInvalidFormatContainerStartTimeout(t *testing.T) {
229+
defer setTestRegion()()
230+
defer setTestEnv("ECS_CONTAINER_START_TIMEOUT", "invalid")()
231+
ctrl := gomock.NewController(t)
232+
mockEc2Metadata := mock_ec2.NewMockEC2MetadataClient(ctrl)
233+
conf, err := NewConfig(mockEc2Metadata)
234+
assert.NoError(t, err)
235+
assert.Equal(t, conf.ContainerStartTimeout, defaultContainerStartTimeout, "Wrong value for ContainerStartTimeout")
236+
}
237+
238+
func TestZeroValueContainerStartTimeout(t *testing.T) {
239+
defer setTestRegion()()
240+
defer setTestEnv("ECS_CONTAINER_START_TIMEOUT", "0s")()
241+
ctrl := gomock.NewController(t)
242+
mockEc2Metadata := mock_ec2.NewMockEC2MetadataClient(ctrl)
243+
conf, err := NewConfig(mockEc2Metadata)
244+
assert.NoError(t, err)
245+
assert.Equal(t, conf.ContainerStartTimeout, defaultContainerStartTimeout, "Wrong value for ContainerStartTimeout")
246+
}
247+
248+
func TestInvalidValueContainerStartTimeout(t *testing.T) {
249+
defer setTestRegion()()
250+
defer setTestEnv("ECS_CONTAINER_START_TIMEOUT", "-10s")()
251+
ctrl := gomock.NewController(t)
252+
mockEc2Metadata := mock_ec2.NewMockEC2MetadataClient(ctrl)
253+
conf, err := NewConfig(mockEc2Metadata)
254+
assert.NoError(t, err)
255+
assert.Equal(t, conf.ContainerStartTimeout, minimumContainerStartTimeout, "Wrong value for ContainerStartTimeout")
215256
}
216257

217258
func TestInvalidFormatParseEnvVariableUint16(t *testing.T) {

agent/config/config_unix.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package config
1616

1717
import (
1818
"fmt"
19+
"time"
1920

2021
"github.com/aws/amazon-ecs-agent/agent/engine/dockerclient"
2122
)
@@ -31,6 +32,10 @@ const (
3132
// Default cgroup memory system root path, this is the default used if the
3233
// path has not been configured through ECS_CGROUP_PATH
3334
defaultCgroupPath = "/sys/fs/cgroup"
35+
// defaultContainerStartTimeout specifies the value for container start timeout duration
36+
defaultContainerStartTimeout = 3 * time.Minute
37+
// minimumContainerStartTimeout specifies the minimum value for starting a container
38+
minimumContainerStartTimeout = 45 * time.Second
3439
)
3540

3641
// DefaultConfig returns the default configuration for Linux
@@ -45,7 +50,8 @@ func DefaultConfig() Config {
4550
ReservedMemory: 0,
4651
AvailableLoggingDrivers: []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver},
4752
TaskCleanupWaitDuration: DefaultTaskCleanupWaitDuration,
48-
DockerStopTimeout: DefaultDockerStopTimeout,
53+
DockerStopTimeout: defaultDockerStopTimeout,
54+
ContainerStartTimeout: defaultContainerStartTimeout,
4955
CredentialsAuditLogFile: defaultCredentialsAuditLogFile,
5056
CredentialsAuditLogDisabled: false,
5157
ImageCleanupDisabled: false,

agent/config/config_unix_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// +build !windows
2-
// Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2014-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License"). You may
55
// not use this file except in compliance with the License. A copy of the
@@ -41,6 +41,7 @@ func TestConfigDefault(t *testing.T) {
4141
assert.Equal(t, 5, len(cfg.ReservedPorts), "Default reserved ports set incorrectly")
4242
assert.Equal(t, uint16(0), cfg.ReservedMemory, "Default reserved memory set incorrectly")
4343
assert.Equal(t, 30*time.Second, cfg.DockerStopTimeout, "Default docker stop container timeout set incorrectly")
44+
assert.Equal(t, 3*time.Minute, cfg.ContainerStartTimeout, "Default docker start container timeout set incorrectly")
4445
assert.False(t, cfg.PrivilegedDisabled, "Default PrivilegedDisabled set incorrectly")
4546
assert.Equal(t, []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver},
4647
cfg.AvailableLoggingDrivers, "Default logging drivers set incorrectly")

agent/config/config_windows.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package config
1616

1717
import (
1818
"os"
19+
"time"
1920
"path/filepath"
2021

2122
"github.com/aws/amazon-ecs-agent/agent/engine/dockerclient"
@@ -41,6 +42,10 @@ const (
4142
dnsPort = 53
4243
// NetBIOS over TCP/IP
4344
netBIOSPort = 139
45+
// defaultContainerStartTimeout specifies the value for container start timeout duration
46+
defaultContainerStartTimeout = 8 * time.Minute
47+
// minimumContainerStartTimeout specifies the minimum value for starting a container
48+
minimumContainerStartTimeout = 2 * time.Minute
4449
)
4550

4651
// DefaultConfig returns the default configuration for Windows
@@ -73,7 +78,8 @@ func DefaultConfig() Config {
7378
ReservedMemory: 0,
7479
AvailableLoggingDrivers: []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver, dockerclient.AWSLogsDriver},
7580
TaskCleanupWaitDuration: DefaultTaskCleanupWaitDuration,
76-
DockerStopTimeout: DefaultDockerStopTimeout,
81+
DockerStopTimeout: defaultDockerStopTimeout,
82+
ContainerStartTimeout: defaultContainerStartTimeout,
7783
CredentialsAuditLogFile: filepath.Join(ecsRoot, defaultCredentialsAuditLogFile),
7884
CredentialsAuditLogDisabled: false,
7985
ImageCleanupDisabled: false,

agent/config/config_windows_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// !build windows
2-
// Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2014-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License"). You may
55
// not use this file except in compliance with the License. A copy of the
@@ -38,6 +38,7 @@ func TestConfigDefault(t *testing.T) {
3838
assert.Equal(t, 10, len(cfg.ReservedPorts), "Default reserved ports set incorrectly")
3939
assert.Equal(t, uint16(0), cfg.ReservedMemory, "Default reserved memory set incorrectly")
4040
assert.Equal(t, 30*time.Second, cfg.DockerStopTimeout, "Default docker stop container timeout set incorrectly")
41+
assert.Equal(t, 8*time.Minute, cfg.ContainerStartTimeout, "Default docker start container timeout set incorrectly")
4142
assert.False(t, cfg.PrivilegedDisabled, "Default PrivilegedDisabled set incorrectly")
4243
assert.Equal(t, []dockerclient.LoggingDriver{dockerclient.JSONFileDriver, dockerclient.NoneDriver, dockerclient.AWSLogsDriver},
4344
cfg.AvailableLoggingDrivers, "Default logging drivers set incorrectly")

agent/config/types.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,13 @@ type Config struct {
8585
// other than containers managed by ECS
8686
ReservedMemory uint16
8787

88-
// DockerStopTimeout specifies the amount time before a SIGKILL is issued to
88+
// DockerStopTimeout specifies the amount of time before a SIGKILL is issued to
8989
// containers managed by ECS
9090
DockerStopTimeout time.Duration
9191

92+
// ContainerStartTimeout specifies the amount of time to wait to start a container
93+
ContainerStartTimeout time.Duration
94+
9295
// AvailableLoggingDrivers specifies the logging drivers available for use
9396
// with Docker. If not set, it defaults to ["json-file","none"].
9497
AvailableLoggingDrivers []dockerclient.LoggingDriver

agent/engine/common_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
"github.com/aws/amazon-ecs-agent/agent/api"
2626
"github.com/aws/amazon-ecs-agent/agent/credentials"
27+
"github.com/aws/amazon-ecs-agent/agent/config"
2728
"github.com/aws/amazon-ecs-agent/agent/engine/dockerclient"
2829
"github.com/aws/amazon-ecs-agent/agent/statechange"
2930
"github.com/aws/amazon-ecs-agent/agent/utils/ttime/mocks"
@@ -162,8 +163,8 @@ func validateContainerRunWorkflow(t *testing.T,
162163
containerEventsWG.Done()
163164
}()
164165
}).Return(DockerContainerMetadata{DockerID: containerID})
165-
166-
client.EXPECT().StartContainer(containerID, startContainerTimeout).Do(
166+
defaultConfig := config.DefaultConfig()
167+
client.EXPECT().StartContainer(containerID, defaultConfig.ContainerStartTimeout).Do(
167168
func(id string, timeout time.Duration) {
168169
containerEventsWG.Add(1)
169170
go func() {

agent/engine/docker_client.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const (
6767
LoadImageTimeout = 10 * time.Minute
6868
pullImageTimeout = 2 * time.Hour
6969
createContainerTimeout = 4 * time.Minute
70-
startContainerTimeout = 3 * time.Minute
7170
stopContainerTimeout = 30 * time.Second
7271
removeContainerTimeout = 5 * time.Minute
7372
inspectContainerTimeout = 30 * time.Second
@@ -531,8 +530,8 @@ func (dg *dockerGoClient) createContainer(ctx context.Context,
531530

532531
func (dg *dockerGoClient) StartContainer(id string, timeout time.Duration) DockerContainerMetadata {
533532
// Create a context that times out after the 'timeout' duration
534-
// This is defined by the const 'startContainerTimeout'. Injecting the 'timeout'
535-
// makes it easier to write tests.
533+
// This is defined by the const 'ContainerStartTimeout' in config. Injecting
534+
// the 'timeout' makes it easier to write tests.
536535
// Eventually, the context should be initialized from a parent root context
537536
// instead of TODO.
538537
ctx, cancel := context.WithTimeout(context.TODO(), timeout)

agent/engine/docker_client_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func TestStartContainer(t *testing.T) {
462462
mockDocker.EXPECT().StartContainerWithContext("id", nil, gomock.Any()).Return(nil),
463463
mockDocker.EXPECT().InspectContainerWithContext("id", gomock.Any()).Return(&docker.Container{ID: "id"}, nil),
464464
)
465-
metadata := client.StartContainer("id", startContainerTimeout)
465+
metadata := client.StartContainer("id", defaultConfig.ContainerStartTimeout)
466466
if metadata.Error != nil {
467467
t.Error("Did not expect error")
468468
}
@@ -804,7 +804,7 @@ func TestUsesVersionedClient(t *testing.T) {
804804
mockDocker.EXPECT().StartContainerWithContext(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
805805
mockDocker.EXPECT().InspectContainerWithContext(gomock.Any(), gomock.Any()).Return(nil, errors.New("err"))
806806

807-
vclient.StartContainer("foo", startContainerTimeout)
807+
vclient.StartContainer("foo", defaultConfig.ContainerStartTimeout)
808808
}
809809

810810
func TestUnavailableVersionError(t *testing.T) {
@@ -823,7 +823,7 @@ func TestUnavailableVersionError(t *testing.T) {
823823

824824
factory.EXPECT().GetClient(dockerclient.DockerVersion("1.21")).Times(1).Return(nil, errors.New("Cannot get client"))
825825

826-
metadata := vclient.StartContainer("foo", startContainerTimeout)
826+
metadata := vclient.StartContainer("foo", defaultConfig.ContainerStartTimeout)
827827

828828
if metadata.Error == nil {
829829
t.Fatal("Expected error, didn't get one")

agent/engine/docker_events_buffer_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// +build !integration
2-
// Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2017 - 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License"). You may
55
// not use this file except in compliance with the License. A copy of the

agent/engine/docker_image_manager_integ_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// +build integration
2-
// Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2014-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License"). You may
55
// not use this file except in compliance with the License. A copy of the

agent/engine/docker_image_manager_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// +build !integration
2-
// Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2014-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License"). You may
55
// not use this file except in compliance with the License. A copy of the

0 commit comments

Comments
 (0)