Repository navigation
Rotation live tests wait for the logging collector to write a burst before asserting on it - #4707
Merged
Merged
Conversation
… before asserting on it (#4704)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rotation live tests wait for the logging collector to write a burst before asserting on it.
Why
PgServerLogTailRotationLiveTests.ALogThatGrewPastTheWindow_DisclosesTheBytesSkipped_AndCollectsTheLastWindowfailed once in CI (Darling PG tests shard 1, run for #4706 at 1954b70, 2026-09-29):Assert.Equal(1, Count(cycle.Rows, pid))got 0. The test RAISEs about 6.5 MB of LOG lines, logs its marker, then reads once. PostgreSQL's logging collector writes from a pipe asynchronously, so right after a multi-MB burst the marker line can still be unwritten when the read runs. The product read is not at fault; the test read too early.Change (test files only)
PgServerLogTailRotationLiveTests: aCycleUntilLoggedAsynchelper repeats ONE logical read (the same carried state on every attempt, never advanced) every 500 ms until the marker's pid is in the rows, for up to 30 s, and on the deadline fails naming the pid, the file read, the attempts, the rows and the bytes skipped. The grew-past-the-window test uses it; both of its assertions are unchanged (bytes skipped > 0, and the marker counted exactly once, so a retry cannot hide a duplicate).PgLogBurstAndRotationLiveTests: the same wait, as a predicate helper, before the single-file 500-deadlock burst's assertions (waits for the newest deadlock's tag;Rows.Count == 500unchanged) and before the csv quoted multi-line record's first cycle (waits for the record's tag; exactly-once unchanged).RotateAsyncalready waits),PgServerLogTailCsvJsonRotationLiveTests(small RAISEs only) andPgDeadlocksResumeLiveTests(already polls for the new file).Verification
DocCommentHygieneTests, three runs on local stderr, csvlog and jsonlog targets configured like the CI clusters: 92 tests each run, 0 failed, 0 skipped.CHANGELOG
None: test-only.