From edc3368e885a4e422742b7b3c9104770c3cabb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Fri, 23 Apr 2021 15:44:37 +0200 Subject: [PATCH] Stabilize TestFilestreamTruncate test Closes #25217 --- filebeat/input/filestream/input_integration_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/filebeat/input/filestream/input_integration_test.go b/filebeat/input/filestream/input_integration_test.go index f15cb66ae5e..6b89c51caca 100644 --- a/filebeat/input/filestream/input_integration_test.go +++ b/filebeat/input/filestream/input_integration_test.go @@ -860,8 +860,6 @@ func TestFilestreamSymlinkRemoved(t *testing.T) { // test_truncate from test_harvester.py func TestFilestreamTruncate(t *testing.T) { - t.Skip("Flaky test: https://github.com/elastic/beats/issues/25217") - env := newInputTestingEnvironment(t) testlogName := "test.log" @@ -870,8 +868,9 @@ func TestFilestreamTruncate(t *testing.T) { "paths": []string{ env.abspath("*"), }, - "prospector.scanner.check_interval": "1ms", - "prospector.scanner.symlinks": "true", + "prospector.scanner.check_interval": "1ms", + "prospector.scanner.resend_on_touch": "true", + "prospector.scanner.symlinks": "true", }) lines := []byte("first line\nsecond line\nthird line\n") @@ -897,8 +896,7 @@ func TestFilestreamTruncate(t *testing.T) { moreLines := []byte("forth line\nfifth line\n") env.mustWriteLinesToFile(testlogName, moreLines) - env.waitUntilEventCount(5) - env.requireOffsetInRegistry(testlogName, len(moreLines)) + env.waitUntilOffsetInRegistry(testlogName, len(moreLines)) cancelInput() env.waitUntilInputStops()