Skip to content

[Flaky Test] TestDataAddedAfterCloseInactive: missing 'file is inactive' logs #49144

@belimawr

Description

@belimawr

Flaky Test

Stack Trace

=== Failed
=== FAIL: filebeat/input/filestream TestDataAddedAfterCloseInactive (5.10s)
    input_integration_test.go:1214: did not find ''/tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log' is inactive' in the logs
    input_integration_test.go:1214:
        	Error Trace:	/opt/buildkite-agent/.asdf/installs/golang/1.24.13/packages/pkg/mod/github.com/elastic/elastic-agent-libs@v0.32.2/logp/logptest/logger.go:136
        	            				/opt/buildkite-agent/builds/bk-agent-prod-gcp-1772042590229085135/elastic/filebeat/filebeat/input/filestream/environment_test.go:557
        	            				/opt/buildkite-agent/builds/bk-agent-prod-gcp-1772042590229085135/elastic/filebeat/filebeat/input/filestream/input_integration_test.go:1214
        	Error:      	Condition never satisfied
        	Test:       	TestDataAddedAfterCloseInactive
        	Messages:   	missing 'file is inactive' logs
    input_integration_test.go:1174: log file path: /tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log
    logger.go:108: Full logs written to ../../build/integration-tests/testing-logger-563609431.log

Section of the logs

{"log.level":"debug","@timestamp":"2026-02-25T18:09:46.396Z","log.logger":"input.filestream","message":"newLogFileReader with config.MaxBytes:10485760","source_file":"filestream::fake-ID-7974bb39-8f46-4bbd-b255-766a81189a0f::fingerprint::0368fcd584bbb95280b502b67c11443e078e06b88b014b9e12b3e064bb8420f8","path":"/tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log","state-id":"fingerprint::0368fcd584bbb95280b502b67c11443e078e06b88b014b9e12b3e064bb8420f8"}
{"log.level":"debug","@timestamp":"2026-02-25T18:09:46.396Z","log.logger":"input.filestream","message":"End of file reached: /tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log; Backoff now.","source_file":"filestream::fake-ID-7974bb39-8f46-4bbd-b255-766a81189a0f::fingerprint::0368fcd584bbb95280b502b67c11443e078e06b88b014b9e12b3e064bb8420f8","path":"/tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log","state-id":"fingerprint::0368fcd584bbb95280b502b67c11443e078e06b88b014b9e12b3e064bb8420f8"}
{"log.level":"debug","@timestamp":"2026-02-25T18:09:47.396Z","log.logger":"input.filestream","message":"'/tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log' is inactive","source_file":"filestream::fake-ID-7974bb39-8f46-4bbd-b255-766a81189a0f::fingerprint::0368fcd584bbb95280b502b67c11443e078e06b88b014b9e12b3e064bb8420f8","path":"/tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log","state-id":"fingerprint::0368fcd584bbb95280b502b67c11443e078e06b88b014b9e12b3e064bb8420f8"}
{"log.level":"debug","@timestamp":"2026-02-25T18:09:48.396Z","log.logger":"filestream.file_watcher","message":"Start next scan","id":"fake-ID-7974bb39-8f46-4bbd-b255-766a81189a0f"}

The test first waits for

End of file reached: /tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log; Backoff now.

then it looks for

'/tmp/TestDataAddedAfterCloseInactive1858040114/002/log.log' is inactive

and waits up to 3 seconds. Looking at the logs, the messages were logged within a second from each other.

I'm not changing the test for now and keeping this issue here for reference. If the test fails again, we can try removing the fist log assertion.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions