waitForQueryLog waits for the query log to contain at least minEntries entries, polling at regular intervals until the timeout is reached.
(t *testing.T, path string, minEntries int)
| 453 | // waitForQueryLog waits for the query log to contain at least minEntries entries, |
| 454 | // polling at regular intervals until the timeout is reached. |
| 455 | func waitForQueryLog(t *testing.T, path string, minEntries int) []queryLogLine { |
| 456 | t.Helper() |
| 457 | var ql []queryLogLine |
| 458 | require.Eventually(t, func() bool { |
| 459 | ql = readQueryLog(t, path) |
| 460 | return len(ql) >= minEntries |
| 461 | }, 5*time.Second, 100*time.Millisecond, "timed out waiting for query log to have at least %d entries, got %d", minEntries, len(ql)) |
| 462 | return ql |
| 463 | } |
| 464 | |
| 465 | func TestQueryLog(t *testing.T) { |
| 466 | if testing.Short() { |
no test coverage detected
searching dependent graphs…