assertLifecyclePair asserts that the captured slog output contains both a "Query started." line and a "Query finished." line — the invariant PR #519 enforces: every query that runs on a worker, regardless of which pgwire protocol path serviced it, gets a matched start/finish pair so a LogQL filter o
(t *testing.T, buf *bytes.Buffer, label string)
| 98 | // PR #519 enforces: every query that runs on a worker, regardless of which |
| 99 | // pgwire protocol path serviced it, gets a matched start/finish pair so a |
| 100 | // LogQL filter on the message catches all of them. |
| 101 | func assertLifecyclePair(t *testing.T, buf *bytes.Buffer, label string) { |
| 102 | t.Helper() |
| 103 | out := buf.String() |
| 104 | if !strings.Contains(out, `msg="Worker statement started."`) { |
| 105 | t.Errorf("[%s] missing 'Worker statement started.' in:\n%s", label, out) |
| 106 | } |
| 107 | if !strings.Contains(out, `msg="Worker statement finished."`) { |
| 108 | t.Errorf("[%s] missing 'Worker statement finished.' in:\n%s", label, out) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func TestLifecycleLogsBoundOversizedQueryText(t *testing.T) { |
no test coverage detected