elastic / elastic/beats

[Flaky Test] filebeat/input/filestream TestFileWatcher on Windows

Open
#37,998 2 comments 0 reactions 0 assignees View on GitHub
:Windows Filebeat flaky-test Team:Elastic-Agent-Data-Plane
Dominant language
Go
Stars
12.7k
Forks
5k
Avg merge
2d 1h
Merged PRs (30d)
370

Description

## Flaky Test

* **Test Name:** TestFileWatcher/does_not_emit_events_for_empty_files/issues_a_warning_in_logs
* **Link:** [Link to file/line number in github.](https://github.com/elastic/beats/blob/051d06c17ac7a311649c022da31a5884d3e934f1/filebeat/input/filestream/fswatch_test.go#L258)
* **Branch:** main
* **Artifact Link:** https://buildkite.com/elastic/filebeat/builds/2975#018da23f-5282-4a29-a5be-f0414c84a7f7/251-536
* **Notes:** Execution was on Windows 2016

### Stack Trace

```
=== Failed
=== FAIL: filebeat/input/filestream TestFileWatcher/does_not_emit_events_for_empty_files/issues_a_warning_in_logs (0.10s)
fswatch_test.go:282:
Error Trace: C:/buildkite-agent/builds/bk-agent-prod-gcp-1707824088986301277/elastic/filebeat/filebeat/input/filestream/fswatch_test.go:282
Error: Condition never satisfied
Test: TestFileWatcher/does_not_emit_events_for_empty_files/issues_a_warning_in_logs
Messages: required a warning message "file \"C:\\\\Users\\\\buildkite\\\\AppData\\\\Local\\\\Temp\\\\TestFileWatcherdoes_not_emit_events_for_empty_files3183456359\\\\001\\\\created.log\" has no content yet, skipping" but got ""
=== FAIL: filebeat/input/filestream TestFileWatcher/does_not_emit_events_for_empty_files/emits_a_create_event_once_something_is_written_to_the_empty_file (0.00s)
fswatch_test.go:305:
Error Trace: C:/buildkite-agent/builds/bk-agent-prod-gcp-1707824088986301277/elastic/filebeat/filebeat/input/filestream/fswatch_test.go:919
C:/buildkite-agent/builds/bk-agent-prod-gcp-1707824088986301277/elastic/filebeat/filebeat/input/filestream/fswatch_test.go:305
Error: Not equal:
expected: "C:\\Users\\buildkite\\AppData\\Local\\Temp\\TestFileWatcherdoes_not_emit_events_for_empty_files3183456359\\001\\created.log"
actual : ""
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-C:\Users\buildkite\AppData\Local\Temp\TestFileWatcherdoes_not_emit_events_for_empty_files3183456359\001\created.log
+
Test: TestFileWatcher/does_not_emit_events_for_empty_files/emits_a_create_event_once_something_is_written_to_the_empty_file
Messages: NewPath
=== FAIL: filebeat/input/filestream TestFileWatcher/does_not_emit_events_for_empty_files (0.25s)
=== FAIL: filebeat/input/filestream TestFileWatcher (2.05s)
```

Contributor guide

Open the contributing guide

Research direction

Start with filebeat/input/filestream/fswatch_test.go around lines 258, 282, and 305, then reproduce TestFileWatcher/does_not_emit_events_for_empty_files on Windows 2016 using the linked Buildkite failure as context. Done means the warning assertion and the create-event NewPath assertion pass reliably when an empty file is written.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.