Skip to content

Tests: the two-rotation log-tail test allows PostgreSQL 18's repeated lock-wait line - #4919

Merged
erikdarlingdata merged 1 commit into
devfrom
test/log-rotation-repeated-wait-line
Oct 1, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
test/log-rotation-repeated-wait-line

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

What failed

On #4909's CI run (Darling PG tests (2), run 36900036522), PgLogBurstAndRotationLiveTests.TwoRotationsInOneInterval_FinishTheMarkedFile_ReadTheNewestAndCountTheSkippedOne failed at Assert.Equal(1, WaitCount(cycle.Rows, pidA)): expected 1, actual 2. #4909 changes the blocking and deadlock read windows and doesn't touch the server-log tail or this test.

Why

WaitCount counts a backend's "still waiting" lock-wait lines. PostgreSQL 18 logs that line again when the waiting backend wakes on a latch before the lock is granted, so one wait can leave two or more lines under a loaded runner. The same behaviour made the lock-wait live test flaky before (#4895). The test pinned exactly one line per wait.

What changed (tests only)

  • The finished marked file (A) and the newest file (C) must each have at least one "still waiting" line for their wait, and no line may be read twice: the lines for that wait must be distinct by timestamp and text. A re-read of a file repeats both; PostgreSQL 18's repeated line has a later timestamp and a longer wait.
  • The skipped middle file (B) must still contribute nothing, and the files-skipped-by-rotation measurement must still be 1.

Testing

  • Darling.Tests builds with 0 warnings and 0 errors.
  • The test needs a store with stderr logging, so it runs on CI's PG shards.

CHANGELOG

None: a test-only change.

… lock-wait line, and still requires each line once
@erikdarlingdata
erikdarlingdata merged commit dc1ae94 into dev Oct 1, 2026
15 of 16 checks passed
@erikdarlingdata
erikdarlingdata deleted the test/log-rotation-repeated-wait-line branch October 1, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant