Skip to content

Commit

Permalink
runner/docker: collection timeout as a configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Jul 28, 2022
1 parent 4ffe00c commit d19b932
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/runner/local_docker.go
Expand Up @@ -71,6 +71,9 @@ type LocalDockerRunnerConfig struct {
Ulimits []string `toml:"ulimits"`

ExposedPorts ExposedPorts `toml:"exposed_ports"`
// Collection timeout is the time we wait for the sync service to send us the test outcomes after
// all instances have finished.
OutcomesCollectionTimeout time.Duration `toml:"outcomes_collection_timeout"`
}

type testContainerInstance struct {
Expand All @@ -82,10 +85,11 @@ type testContainerInstance struct {
// defaultConfig is the default configuration. Incoming configurations will be
// merged with this object.
var defaultConfig = LocalDockerRunnerConfig{
KeepContainers: false,
Unstarted: false,
Background: false,
Ulimits: []string{"nofile=1048576:1048576"},
KeepContainers: false,
Unstarted: false,
Background: false,
Ulimits: []string{"nofile=1048576:1048576"},
OutcomesCollectionTimeout: time.Second * 30,
}

// LocalDockerRunner is a runner that manually stands up as many docker
Expand Down Expand Up @@ -639,7 +643,7 @@ func (r *LocalDockerRunner) Run(ctx context.Context, input *api.RunInput, ow *rp
}()

startOutcomesCollectTimeout := func() {
time.Sleep(30 * time.Second)
time.Sleep(cfg.OutcomesCollectionTimeout)
outcomesCollectTimeout <- true
}

Expand Down

0 comments on commit d19b932

Please sign in to comment.