diff --git a/internal/install/stack_version.go b/internal/install/stack_version.go index 1f742edd3c..9e07dcf730 100644 --- a/internal/install/stack_version.go +++ b/internal/install/stack_version.go @@ -6,5 +6,5 @@ package install const ( // DefaultStackVersion is the default version of the stack - DefaultStackVersion = "8.5.1" + DefaultStackVersion = "8.6.1" ) diff --git a/internal/profile/_static/docker-compose-stack.yml b/internal/profile/_static/docker-compose-stack.yml index 827e1e62cc..0ad5b8b3e0 100644 --- a/internal/profile/_static/docker-compose-stack.yml +++ b/internal/profile/_static/docker-compose-stack.yml @@ -4,8 +4,8 @@ services: image: "${ELASTICSEARCH_IMAGE_REF}" healthcheck: test: "curl -s --cacert /usr/share/elasticsearch/config/certs/ca-cert.pem -f -u elastic:changeme https://127.0.0.1:9200/_cat/health | cut -f4 -d' ' | grep -E '(green|yellow)'" - retries: 300 - interval: 1s + start_period: 300s + interval: 5s environment: - "ES_JAVA_OPTS=-Xms1g -Xmx1g" - "ELASTIC_PASSWORD=changeme" @@ -32,8 +32,8 @@ services: condition: service_healthy healthcheck: test: "sh /usr/share/kibana/healthcheck.sh" - retries: 600 - interval: 1s + start_period: 600s + interval: 5s env_file: - "../certs/ca.env" environment: @@ -60,8 +60,8 @@ services: PROFILE: "${PROFILE_NAME}" healthcheck: test: ["CMD", "curl", "--cacert", "/etc/ssl/package-registry/ca-cert.pem", "-f", "https://localhost:8080"] - retries: 300 - interval: 1s + start_period: 300s + interval: 5s environment: - "EPR_LOG_LEVEL=debug" - "EPR_ADDRESS=0.0.0.0:8080" @@ -89,7 +89,7 @@ services: condition: service_healthy healthcheck: test: "curl --cacert /etc/ssl/elastic-agent/ca-cert.pem -f https://localhost:8220/api/status | grep -i healthy 2>&1 >/dev/null" - retries: 60 + start_period: 60s interval: 5s hostname: docker-fleet-server environment: @@ -124,8 +124,10 @@ services: condition: service_healthy healthcheck: test: "elastic-agent status" + timeout: 2s + start_period: 360s retries: 180 - interval: 1s + interval: 5s hostname: docker-fleet-agent env_file: "./elastic-agent.${STACK_VERSION_VARIANT}.env" volumes: diff --git a/internal/stack/boot.go b/internal/stack/boot.go index 61b1426bb3..b2262a7ed7 100644 --- a/internal/stack/boot.go +++ b/internal/stack/boot.go @@ -60,12 +60,41 @@ func BootUp(options Options) error { err = dockerComposeUp(options) if err != nil { + // At least starting on 8.6.0, fleet-server may be reconfigured or + // restarted after being healthy. If elastic-agent tries to enroll at + // this moment, it fails inmediately, stopping and making `docker-compose up` + // to fail too. + // As a workaround, try to give another chance to docker-compose if only + // elastic-agent failed. + if onlyElasticAgentFailed() { + fmt.Println("Elastic Agent failed to start, trying again.") + err = dockerComposeUp(options) + } return errors.Wrap(err, "running docker-compose failed") } return nil } +func onlyElasticAgentFailed() bool { + status, err := Status() + if err != nil { + fmt.Printf("Failed to check status of the stack after failure: %v\n", err) + return false + } + + for _, service := range status { + if strings.Contains(service.Name, "elastic-agent") { + continue + } + if !strings.HasPrefix(service.Status, "running") { + return false + } + } + + return true +} + // TearDown function takes down the testing stack. func TearDown(options Options) error { err := dockerComposeDown(options) diff --git a/test/packages/benchmarks/pipeline_benchmark/manifest.yml b/test/packages/benchmarks/pipeline_benchmark/manifest.yml index f7713fd52c..bce8399a28 100644 --- a/test/packages/benchmarks/pipeline_benchmark/manifest.yml +++ b/test/packages/benchmarks/pipeline_benchmark/manifest.yml @@ -7,7 +7,6 @@ title: Pipeline benchmarks version: 999.999.999 description: Test for pipeline test runner categories: ["network"] -release: experimental license: basic type: integration conditions: diff --git a/test/packages/benchmarks/use_pipeline_tests/manifest.yml b/test/packages/benchmarks/use_pipeline_tests/manifest.yml index b30a02942b..f145d71818 100644 --- a/test/packages/benchmarks/use_pipeline_tests/manifest.yml +++ b/test/packages/benchmarks/use_pipeline_tests/manifest.yml @@ -7,7 +7,6 @@ title: Use pipeline tests for the benchmark version: 999.999.999 description: Test for pipeline test runner categories: ["network"] -release: experimental license: basic type: integration conditions: diff --git a/test/packages/other/multiinput/manifest.yml b/test/packages/other/multiinput/manifest.yml index 7eb589115b..7ffaf75b38 100644 --- a/test/packages/other/multiinput/manifest.yml +++ b/test/packages/other/multiinput/manifest.yml @@ -7,7 +7,6 @@ title: Multi-input test version: 999.999.999 description: Test for multiple input tests categories: ["network"] -release: experimental license: basic type: integration conditions: diff --git a/test/packages/other/pipeline_tests/manifest.yml b/test/packages/other/pipeline_tests/manifest.yml index 042c0d21ff..96df3f5237 100644 --- a/test/packages/other/pipeline_tests/manifest.yml +++ b/test/packages/other/pipeline_tests/manifest.yml @@ -7,7 +7,6 @@ title: Pipeline tests version: 999.999.999 description: Test for pipeline test runner categories: ["network"] -release: experimental license: basic type: integration conditions: