From 639fc23430d70816b0a1262307a6ff2d0e98fd2d Mon Sep 17 00:00:00 2001 From: ev1yehor <146825775+ev1yehor@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:54:04 +0300 Subject: [PATCH 1/5] Migrate github checks to buildkite for auditbeat and x-pack/auditbeat (#39868) * Update * image update --- .buildkite/auditbeat/auditbeat-pipeline.yml | 27 ++++++++++++++++++ .../x-pack/pipeline.xpack.auditbeat.yml | 27 ++++++++++++++++++ .github/workflows/check-auditbeat.yml | 28 ------------------- 3 files changed, 54 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/check-auditbeat.yml diff --git a/.buildkite/auditbeat/auditbeat-pipeline.yml b/.buildkite/auditbeat/auditbeat-pipeline.yml index 2ac4a8911a1..f5ca39b3645 100644 --- a/.buildkite/auditbeat/auditbeat-pipeline.yml +++ b/.buildkite/auditbeat/auditbeat-pipeline.yml @@ -27,6 +27,33 @@ env: TEST_COVERAGE: "true" steps: + - group: "Auditbeat Check/Update" + key: "auditbeat-check-update" + + steps: + - label: "Run check/update" + command: | + make -C auditbeat check update + make check-no-changes + retry: + automatic: + - limit: 3 + agents: + image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + cpu: "4000m" + memory: "8Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "auditbeat: check/update" + + - wait: ~ + # with PRs, we want to run mandatory tests only if check/update step succeed + # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests + # this allows building DRA artifacts even if there is flakiness in check/update step + if: build.env("BUILDKITE_PULL_REQUEST") != "false" + depends_on: "auditbeat-check-update" + - group: "Auditbeat Mandatory Testing" key: "auditbeat-mandatory-tests" diff --git a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml index a851f681d33..9552cc14ef9 100644 --- a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml @@ -27,6 +27,33 @@ env: TEST_COVERAGE: "true" steps: + - group: "x-pack/auditbeat Check/Update" + key: "x-pack-auditbeat-check-update" + + steps: + - label: "Run check/update" + command: | + make -C x-pack/auditbeat check update + make check-no-changes + retry: + automatic: + - limit: 3 + agents: + image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest" + cpu: "4000m" + memory: "8Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "x-pack/auditbeat: check/update" + + - wait: ~ + # with PRs, we want to run mandatory tests only if check/update step succeed + # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests + # this allows building DRA artifacts even if there is flakiness in check/update step + if: build.env("BUILDKITE_PULL_REQUEST") != "false" + depends_on: "x-pack-auditbeat-check-update" + - group: "x-pack/auditbeat Mandatory Tests" key: "x-pack-auditbeat-mandatory-tests" diff --git a/.github/workflows/check-auditbeat.yml b/.github/workflows/check-auditbeat.yml deleted file mode 100644 index bbc96242687..00000000000 --- a/.github/workflows/check-auditbeat.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: check-auditbeat - -on: - pull_request: - paths: - - '.github/workflows/check-auditbeat.yml' - - 'auditbeat/**' - - 'x-pack/auditbeat/**' - -env: - BEAT_MODULE: 'auditbeat' - -permissions: - contents: read - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: .go-version - - name: Run check/update - run: | - go install github.com/magefile/mage - make -C ${{ env.BEAT_MODULE }} check update - make check-no-changes From b5155a177edea5ca97b6f5aaecc020d95d8350f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 08:57:32 -0400 Subject: [PATCH 2/5] [Automation] Bump Golang version to 1.21.11 (#39851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: Update Auditbeat Dockerfile Made with ❤️️ by updatecli * chore: Update Filebeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update from vsphere Dockerfile Made with ❤️️ by updatecli * chore: Update Heartbeat Dockerfile Made with ❤️️ by updatecli * chore: Update NATS module Dockerfile Made with ❤️️ by updatecli * chore: Update version.asciidoc Made with ❤️️ by updatecli * chore: Update Metricbeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update Metricbeat Dockerfile Made with ❤️️ by updatecli * chore: Update HTTP module Dockerfile Made with ❤️️ by updatecli * chore: Update .go-version Made with ❤️️ by updatecli * chore: Update go.mod Made with ❤️️ by updatecli * chore: Update Functionbeat Dockerfile Made with ❤️️ by updatecli * chore: Update Packetbeat Dockerfile Made with ❤️️ by updatecli * chore: Update stan Dockerfile Made with ❤️️ by updatecli * chore: Update .golangci.yml Made with ❤️️ by updatecli * chore: Update Heartbeat debug Dockerfile Made with ❤️️ by updatecli * Update changelog. * Run go mod tidy. * chore: Update .go-version Made with ❤️️ by updatecli * chore: Update Packetbeat Dockerfile Made with ❤️️ by updatecli * chore: Update Filebeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update Heartbeat Dockerfile Made with ❤️️ by updatecli * chore: Update version.asciidoc Made with ❤️️ by updatecli * chore: Update Metricbeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update stan Dockerfile Made with ❤️️ by updatecli * chore: Update go.mod Made with ❤️️ by updatecli * chore: Update Metricbeat Dockerfile Made with ❤️️ by updatecli * chore: Update Heartbeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update HTTP module Dockerfile Made with ❤️️ by updatecli * chore: Update NATS module Dockerfile Made with ❤️️ by updatecli * chore: Update from vsphere Dockerfile Made with ❤️️ by updatecli * chore: Update Functionbeat Dockerfile Made with ❤️️ by updatecli * chore: Update .golangci.yml Made with ❤️️ by updatecli * chore: Update Auditbeat Dockerfile Made with ❤️️ by updatecli * Exclude Dockerfile from module detection Signed-off-by: Alexandros Sapranidis * Update go.mod Signed-off-by: Alexandros Sapranidis * chore: Update from vsphere Dockerfile Made with ❤️️ by updatecli * chore: Update Heartbeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update Metricbeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update Functionbeat Dockerfile Made with ❤️️ by updatecli * chore: Update go.mod Made with ❤️️ by updatecli * chore: Update Heartbeat Dockerfile Made with ❤️️ by updatecli * chore: Update Filebeat debug Dockerfile Made with ❤️️ by updatecli * chore: Update NATS module Dockerfile Made with ❤️️ by updatecli * chore: Update stan Dockerfile Made with ❤️️ by updatecli * chore: Update HTTP module Dockerfile Made with ❤️️ by updatecli * chore: Update Metricbeat Dockerfile Made with ❤️️ by updatecli * chore: Update version.asciidoc Made with ❤️️ by updatecli * chore: Update .golangci.yml Made with ❤️️ by updatecli * chore: Update Packetbeat Dockerfile Made with ❤️️ by updatecli * chore: Update Auditbeat Dockerfile Made with ❤️️ by updatecli * chore: Update .go-version Made with ❤️️ by updatecli * go mod tidy --------- Signed-off-by: Alexandros Sapranidis Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Craig MacKenzie Co-authored-by: Alexandros Sapranidis --- .buildkite/scripts/changesets.sh | 2 +- .go-version | 2 +- .golangci.yml | 8 ++++---- CHANGELOG.next.asciidoc | 2 +- auditbeat/Dockerfile | 2 +- dev-tools/kubernetes/filebeat/Dockerfile.debug | 2 +- dev-tools/kubernetes/heartbeat/Dockerfile.debug | 2 +- dev-tools/kubernetes/metricbeat/Dockerfile.debug | 2 +- go.mod | 2 +- heartbeat/Dockerfile | 2 +- libbeat/docs/version.asciidoc | 2 +- metricbeat/Dockerfile | 2 +- metricbeat/module/http/_meta/Dockerfile | 2 +- metricbeat/module/nats/_meta/Dockerfile | 2 +- metricbeat/module/vsphere/_meta/Dockerfile | 2 +- packetbeat/Dockerfile | 2 +- x-pack/functionbeat/Dockerfile | 2 +- x-pack/metricbeat/module/stan/_meta/Dockerfile | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.buildkite/scripts/changesets.sh b/.buildkite/scripts/changesets.sh index 7e79d2d3164..1ab80edc585 100644 --- a/.buildkite/scripts/changesets.sh +++ b/.buildkite/scripts/changesets.sh @@ -15,7 +15,7 @@ definePattern() { } defineExclusions() { - exclude="^$beatPath\/module\/(.*(? Date: Thu, 13 Jun 2024 15:15:40 +0200 Subject: [PATCH 3/5] docs: Prepare Changelog for 8.14.1 (#39864) (#39882) * docs: Close changelog for 8.14.1 * Update CHANGELOG.asciidoc * Update CHANGELOG.next.asciidoc --------- Co-authored-by: Pierre HILBERT (cherry picked from commit f68af7f3d287df593abcca6b62ed5cff8a0fe01b) Co-authored-by: Elastic Machine Co-authored-by: Lisa Cawley --- CHANGELOG.asciidoc | 11 ++++++ CHANGELOG.next.asciidoc | 68 ----------------------------------- libbeat/docs/release.asciidoc | 1 + 3 files changed, 12 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 83844526f9d..6d12414d6e2 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -3,6 +3,17 @@ :issue: https://github.com/elastic/beats/issues/ :pull: https://github.com/elastic/beats/pull/ +[[release-notes-8.14.1]] +=== Beats version 8.14.1 +https://github.com/elastic/beats/compare/v8.14.0\...v8.14.1[View commits] + +==== Bugfixes + +*Heartbeat* + +- Fix import of browser plugin for Agentbeat. {pull}39818[39818] + + [[release-notes-8.14.0]] === Beats version 8.14.0 https://github.com/elastic/beats/compare/v8.13.4\...v8.14.0[View commits] diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 33bbcc055bc..88656f51363 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -145,12 +145,6 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] *Heartbeat* -- Fix panics when parsing dereferencing invalid parsed url. {pull}34702[34702] -- Fix setuid root when running under cgroups v2. {pull}37794[37794] -- Adjust State loader to only retry when response code status is 5xx {pull}37981[37981] -- Reset prctl dumpable flag after cap drop. {pull}38269[38269] -- Redact synthexec cmd output. {pull}39535[39535] -- Fix import of browser plugin for agentbeat. {pull}39818[39818] *Heartbeat* @@ -362,65 +356,3 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] ==== Known Issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libbeat/docs/release.asciidoc b/libbeat/docs/release.asciidoc index bad3f87b38d..3dc94738d12 100644 --- a/libbeat/docs/release.asciidoc +++ b/libbeat/docs/release.asciidoc @@ -8,6 +8,7 @@ This section summarizes the changes in each release. Also read <> for more detail about changes that affect upgrade. +* <> * <> * <> * <> From 2f91cf1b07d1e6bb72df4858cb324d5c44bfda21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constan=C3=A7a=20Manteigas?= <113898685+constanca-m@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:26:52 +0200 Subject: [PATCH 4/5] [Kubernetes Provider] Apply namespace filter to watchers (#39881) * Apply namespace filter Signed-off-by: constanca * Apply namespace filter Signed-off-by: constanca * Fix namespace docs description Signed-off-by: constanca --------- Signed-off-by: constanca --- CHANGELOG.next.asciidoc | 1 + .../autodiscover/providers/kubernetes/pod.go | 20 ++++++++++++------- .../providers/kubernetes/service.go | 5 +++-- libbeat/docs/shared-autodiscover.asciidoc | 7 ++----- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 88656f51363..15e4fd614db 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -151,6 +151,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] *Metricbeat* +- Fix `namespace` filter option at Kubernetes provider level. {pull}39881[39881] - Fix Azure Monitor 429 error by causing metricbeat to retry the request again. {pull}38294[38294] - Fix fields not being parsed correctly in postgresql/database {issue}25301[25301] {pull}37720[37720] - rabbitmq/queue - Change the mapping type of `rabbitmq.queue.consumers.utilisation.pct` to `scaled_float` from `long` because the values fall within the range of `[0.0, 1.0]`. Previously, conversion to integer resulted in reporting either `0` or `1`. diff --git a/libbeat/autodiscover/providers/kubernetes/pod.go b/libbeat/autodiscover/providers/kubernetes/pod.go index b11faac4931..c5f9c721eb9 100644 --- a/libbeat/autodiscover/providers/kubernetes/pod.go +++ b/libbeat/autodiscover/providers/kubernetes/pod.go @@ -100,9 +100,9 @@ func NewPodEventer(uuid uuid.UUID, cfg *conf.C, client k8s.Interface, publish fu if metaConf.Node.Enabled() || config.Hints.Enabled() { options := kubernetes.WatchOptions{ - SyncTimeout: config.SyncPeriod, - Node: config.Node, - Namespace: config.Namespace, + SyncTimeout: config.SyncPeriod, + Node: config.Node, + HonorReSyncs: true, } nodeWatcher, err = kubernetes.NewNamedWatcher("node", client, &kubernetes.Node{}, options, nil) if err != nil { @@ -112,20 +112,24 @@ func NewPodEventer(uuid uuid.UUID, cfg *conf.C, client k8s.Interface, publish fu if metaConf.Namespace.Enabled() || config.Hints.Enabled() { namespaceWatcher, err = kubernetes.NewNamedWatcher("namespace", client, &kubernetes.Namespace{}, kubernetes.WatchOptions{ - SyncTimeout: config.SyncPeriod, + SyncTimeout: config.SyncPeriod, + Namespace: config.Namespace, + HonorReSyncs: true, }, nil) if err != nil { logger.Errorf("couldn't create watcher for %T due to error %+v", &kubernetes.Namespace{}, err) } } - // Resource is Pod so we need to create watchers for Replicasets and Jobs that it might belongs to + // Resource is Pod, so we need to create watchers for Replicasets and Jobs that it might belong to // in order to be able to retrieve 2nd layer Owner metadata like in case of: // Deployment -> Replicaset -> Pod // CronJob -> job -> Pod if metaConf.Deployment { replicaSetWatcher, err = kubernetes.NewNamedWatcher("resource_metadata_enricher_rs", client, &kubernetes.ReplicaSet{}, kubernetes.WatchOptions{ - SyncTimeout: config.SyncPeriod, + SyncTimeout: config.SyncPeriod, + Namespace: config.Namespace, + HonorReSyncs: true, }, nil) if err != nil { logger.Errorf("Error creating watcher for %T due to error %+v", &kubernetes.ReplicaSet{}, err) @@ -133,7 +137,9 @@ func NewPodEventer(uuid uuid.UUID, cfg *conf.C, client k8s.Interface, publish fu } if metaConf.CronJob { jobWatcher, err = kubernetes.NewNamedWatcher("resource_metadata_enricher_job", client, &kubernetes.Job{}, kubernetes.WatchOptions{ - SyncTimeout: config.SyncPeriod, + SyncTimeout: config.SyncPeriod, + Namespace: config.Namespace, + HonorReSyncs: true, }, nil) if err != nil { logger.Errorf("Error creating watcher for %T due to error %+v", &kubernetes.Job{}, err) diff --git a/libbeat/autodiscover/providers/kubernetes/service.go b/libbeat/autodiscover/providers/kubernetes/service.go index ba62dda9c47..e9e71c921bd 100644 --- a/libbeat/autodiscover/providers/kubernetes/service.go +++ b/libbeat/autodiscover/providers/kubernetes/service.go @@ -74,8 +74,9 @@ func NewServiceEventer(uuid uuid.UUID, cfg *conf.C, client k8s.Interface, publis if metaConf.Namespace.Enabled() || config.Hints.Enabled() { namespaceWatcher, err = kubernetes.NewNamedWatcher("namespace", client, &kubernetes.Namespace{}, kubernetes.WatchOptions{ - SyncTimeout: config.SyncPeriod, - Namespace: config.Namespace, + SyncTimeout: config.SyncPeriod, + Namespace: config.Namespace, + HonorReSyncs: true, }, nil) if err != nil { return nil, fmt.Errorf("couldn't create watcher for %T due to error %w", &kubernetes.Namespace{}, err) diff --git a/libbeat/docs/shared-autodiscover.asciidoc b/libbeat/docs/shared-autodiscover.asciidoc index 1e1ea567b7c..83d44b498ac 100644 --- a/libbeat/docs/shared-autodiscover.asciidoc +++ b/libbeat/docs/shared-autodiscover.asciidoc @@ -140,10 +140,7 @@ The `kubernetes` autodiscover provider has the following configuration settings: `node`:: (Optional) Specify the node to scope {beatname_lc} to in case it cannot be accurately detected, as when running {beatname_lc} in host network mode. -`namespace`:: (Optional) Select the namespace from which to collect the - metadata. If it is not set, the processor collects metadata from all - namespaces. It is unset by default. The namespace configuration only applies to - kubernetes resources that are namespace scoped. +`namespace`:: (Optional) Select the namespace from which to collect the events from the resources. If it is not set, the provider collects them from all namespaces. It is unset by default. The namespace configuration only applies to kubernetes resources that are namespace scoped and if `unique` field is set to `false`. `cleanup_timeout`:: (Optional) Specify the time of inactivity before stopping the running configuration for a container, ifeval::["{beatname_lc}"=="filebeat"] @@ -196,7 +193,7 @@ Example: `unique`:: (Optional) Defaults to `false`. Marking an autodiscover provider as unique results into making the provider to enable the provided templates only when it will gain the leader lease. - This setting can only be combined with `cluster` scope. When `unique` is enabled enabled, `resource` + This setting can only be combined with `cluster` scope. When `unique` is enabled, `resource` and `add_resource_metadata` settings are not taken into account. `leader_lease`:: (Optional) Defaults to +{beatname_lc}-cluster-leader+. This will be name of the lock lease. One can monitor the status of the lease with `kubectl describe lease beats-cluster-leader`. From f9fec1e4ff85085093682a1017640cc2e4b097b8 Mon Sep 17 00:00:00 2001 From: VihasMakwana <121151420+VihasMakwana@users.noreply.github.com> Date: Thu, 13 Jun 2024 18:58:16 +0530 Subject: [PATCH 5/5] filebeat: Fix flaky test case on macOS (#39860) * fix: fix a flaky test on macos * fix: fix more such test cases * fix: only update ignore_older * fix: also fix flaky test_restart_state * fix: fix CI --- filebeat/tests/system/test_crawler.py | 4 ++-- filebeat/tests/system/test_harvester.py | 2 +- filebeat/tests/system/test_registrar.py | 14 ++++++++------ filebeat/tests/system/test_shutdown.py | 8 +++++++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/filebeat/tests/system/test_crawler.py b/filebeat/tests/system/test_crawler.py index 2bea57223fe..39f0d454124 100644 --- a/filebeat/tests/system/test_crawler.py +++ b/filebeat/tests/system/test_crawler.py @@ -485,7 +485,7 @@ def test_tail_files(self): self.wait_until( lambda: self.log_contains( "Start next scan"), - max_timeout=5) + max_timeout=10) with open(testfile, 'a') as f: # write additional lines @@ -596,7 +596,7 @@ def test_encodings(self): # run filebeat filebeat = self.start_beat() self.wait_until(lambda: self.output_has(lines=len(encodings)), - max_timeout=15) + max_timeout=25) # write another line in all files for _, enc_py, text in encodings: diff --git a/filebeat/tests/system/test_harvester.py b/filebeat/tests/system/test_harvester.py index 3b40f3a6730..9099abc699e 100644 --- a/filebeat/tests/system/test_harvester.py +++ b/filebeat/tests/system/test_harvester.py @@ -858,6 +858,6 @@ def test_debug_reader(self): # 13 on unix, 14 on windows. self.wait_until(lambda: self.log_contains(re.compile( - 'Matching null byte found at offset (13|14)')), max_timeout=5) + 'Matching null byte found at offset (13|14)')), max_timeout=10) filebeat.check_kill_and_wait() diff --git a/filebeat/tests/system/test_registrar.py b/filebeat/tests/system/test_registrar.py index 53af186dbf9..b08eda2777c 100644 --- a/filebeat/tests/system/test_registrar.py +++ b/filebeat/tests/system/test_registrar.py @@ -252,9 +252,11 @@ def test_registry_file_update_permissions(self): self.assertEqual(self.file_permissions(os.path.join(registry_path, "log.json")), "0o600") + registry_home = "a/b/c/d/registry_x" + registry_path = os.path.join(registry_home, "filebeat") self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", - registry_home="a/b/c/registry_x", + registry_home=registry_home, registry_file_permissions=0o640 ) @@ -266,7 +268,7 @@ def test_registry_file_update_permissions(self): # the logging and actual writing the file. Seems to happen on Windows. self.wait_until( lambda: self.has_registry(registry_path), - max_timeout=1) + max_timeout=10) # Wait a moment to make sure registry is completely written time.sleep(1) @@ -950,7 +952,7 @@ def test_restart_state(self): path=os.path.abspath(self.working_dir) + "/log/*", close_inactive="200ms", ignore_older="2000ms", - clean_inactive="3s", + clean_inactive="10s", ) filebeat = self.start_beat() @@ -976,7 +978,7 @@ def test_restart_state_reset(self): self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", clean_inactive="10s", - ignore_older="5s" + ignore_older="9s" ) os.mkdir(self.working_dir + "/log/") @@ -1003,7 +1005,7 @@ def test_restart_state_reset(self): self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/test2.log", clean_inactive="10s", - ignore_older="5s", + ignore_older="9s", ) filebeat = self.start_beat(output="filebeat2.log") @@ -1137,7 +1139,7 @@ def test_restart_state_reset_ttl_no_clean_inactive(self): self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/test.log", clean_inactive="10s", - ignore_older="5s" + ignore_older="9s" ) os.mkdir(self.working_dir + "/log/") diff --git a/filebeat/tests/system/test_shutdown.py b/filebeat/tests/system/test_shutdown.py index 8f18337435f..8e781837730 100644 --- a/filebeat/tests/system/test_shutdown.py +++ b/filebeat/tests/system/test_shutdown.py @@ -27,7 +27,13 @@ def test_shutdown(self): ) for i in range(1, 5): proc = self.start_beat(logging_args=["-e", "-v"]) - time.sleep(.5) + + # Flaky on MacOS, see https://github.com/elastic/beats/issues/39613#issuecomment-2158812325 + # we need to wait a bit longer for filebeat to start + if platform.system() == "Darwin": + time.sleep(10) + else: + time.sleep(.5) proc.check_kill_and_wait() @unittest.skip("Skipped as flaky: https://github.com/elastic/beats/issues/14647")