Skip to content

test(inputs.tail): Add test coverage for plugin behavior#19136

Merged
srebhan merged 2 commits into
influxdata:masterfrom
skartikey:test/tail-behavior-matrix
Jul 1, 2026
Merged

test(inputs.tail): Add test coverage for plugin behavior#19136
srebhan merged 2 commits into
influxdata:masterfrom
skartikey:test/tail-behavior-matrix

Conversation

@skartikey

@skartikey skartikey commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds engine-level tests for the tail plugin that exercise the tailer behaviors the existing suite leaves uncovered: follow-append, rename/recreate and copytruncate rotation, delete-and-recreate, partial (unterminated) lines, symlinks, and offset resume across a restart. Each scenario runs under both the native watcher and polling (polling only on Windows) so coverage is independent of the watch implementation.

Two behaviors the current library does not satisfy on any platform are recorded as documented t.Skips rather than hidden, so the gaps stay visible:

  • same-length copytruncate: the library flags a truncation only when the file size shrinks (prevSize > size in both watch/polling.go and watch/inotify.go), so a truncate-and-rewrite back to the same length is missed under both the native watcher and polling;
  • mid-multiline resume: on stop the offset is taken from the last byte read rather than the last fully delivered entry, so resuming in the middle of a multi-line entry delivers it truncated.

A few other scenarios are skipped only on the specific watch-method/OS combinations the current library cannot handle (rename/recreate and delete/recreate under the native watcher, symlink target writes via the native watcher on macOS, and several cases under Windows polling); these still run on every other combination.

Intent is to serve as a fixed acceptance gate for the in-progress replacement of the unmaintained influxdata/tail library: the replacement should keep all scenarios green under both watch methods and ideally clear the two skipped behaviors.

Checklist

Related issues

resolves #

@telegraf-tiger telegraf-tiger Bot added the test label Jun 22, 2026
@skartikey skartikey marked this pull request as draft June 22, 2026 13:35
@skartikey skartikey force-pushed the test/tail-behavior-matrix branch from f5de462 to 4d5ca96 Compare June 22, 2026 14:26
@skartikey skartikey force-pushed the test/tail-behavior-matrix branch from f52234f to 7d68e02 Compare June 25, 2026 10:48
@skartikey skartikey marked this pull request as ready for review June 25, 2026 10:48
@skartikey skartikey added area/tail ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Jun 25, 2026
@telegraf-tiger

Copy link
Copy Markdown
Contributor

@srebhan srebhan changed the title test(tail): Add watch-method behavior matrix for the tailer engine test(inputs.tail): Add test coverage for plugin behavior Jul 1, 2026
@telegraf-tiger telegraf-tiger Bot added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label Jul 1, 2026
@srebhan srebhan merged commit 0aaae7d into influxdata:master Jul 1, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tail plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants