File Rotate Truncate Correctness Test
This test verifies that a file is correctly followed when rotated in the manner of
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.
- Each subject is configured to tail a test log file and send it to a downstream service.
- The subject is started.
- The test log file is renamed in a way that it matches the configured patterns.
- Data is copied to a new rotated file.
- The target file is truncated.
- A unique new line is written to both files.
- Assert that the downstream service received both new unique lines and did not receive duplicate data.
You can run this test via:
test -t file_rotate_truncate_correctness