Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
ansible
configurations/default
terraform
README.md

README.md

File Rotate Truncate Correctness Test

This test verifies that a file is correctly followed when rotated in the manner of logrotate's copytruncate directive. The subject should continue to read new data sent to the rotated file and correct reset it's position on the newly truncated file. Failure to do so results in data loss as well as duplicate data.

Design

  1. Each subject is configured to tail a test log file and send it to a downstream service.
  2. The subject is started.
  3. The test log file is renamed in a way that it matches the configured patterns.
  4. Data is copied to a new rotated file.
  5. The target file is truncated.
  6. A unique new line is written to both files.
  7. Assert that the downstream service received both new unique lines and did not receive duplicate data.

Results

Subject Result
Filebeat
FluentBit
FluentD
Logstash
Splunk HF
Splunk UF
Vector

Try it

You can run this test via:

test -t file_rotate_truncate_correctness

Resources

You can’t perform that action at this time.