Subject: mtail: racy TestReadFromPipe test in internal/mtail/read_pipe_integration_test.go Package: mtail Version: 3.0.0~rc38-1 Severity: normal
The latest upload has produced mixed results between buildd and autopkgtest failing to run TestReadFromPipe, e.g. https://buildd.debian.org/status/fetch.php?pkg=mtail&arch=armhf&ver=3.0.0%7Erc38-1&stamp=1606840174&raw=0 is a success: === RUN TestReadFromPipe === RUN TestReadFromPipe/0s_true === RUN TestReadFromPipe/10ms_false --- PASS: TestReadFromPipe (10.02s) --- PASS: TestReadFromPipe/0s_true (5.00s) --- PASS: TestReadFromPipe/10ms_false (5.01s) But for example autopkgtest amd64 failed: https://ci.debian.net/data/autopkgtest/testing/amd64/m/mtail/8626687/log.gz === RUN TestReadFromPipe === RUN TestReadFromPipe/0s_true === RUN TestReadFromPipe/10ms_false read_pipe_integration_test.go:53: Did not see "lines_total" have delta by deadline: got 0 - 0 = 0, want 3 --- FAIL: TestReadFromPipe (65.01s) --- PASS: TestReadFromPipe/0s_true (5.00s) --- FAIL: TestReadFromPipe/10ms_false (60.00s) === RUN TestTruncatedLogRead === RUN TestTruncatedLogRead/0s_true === RUN TestTruncatedLogRead/10ms_false --- PASS: TestTruncatedLogRead (0.09s) --- PASS: TestTruncatedLogRead/0s_true (0.05s) --- PASS: TestTruncatedLogRead/10ms_false (0.04s) FAIL FAIL github.com/google/mtail/internal/mtail 69.897s The internal/mtail/read_pipe_integration_test.go test file has been changed recently upstream, specifically removing the "integration" tag in f45531acd69a and refactoring the pollInterval initialization in a2353dd63. The latter commit seems to have changed the number of invocations for this test from one with 0 pollInterval and fsnotify disable to running the test twice based on LogWatcherTestTable (below) which I think is part of the culprit. +// logWatcherTestTable contains reusable inputs to NewLogWatcher under test. +var LogWatcherTestTable = []struct { + PollInterval time.Duration + EnableFsNotify bool +}{ + {0, true}, // notify only + {10 * time.Millisecond, false}, // poll only +}