MCPcopy Index your code
hub / github.com/prometheus/prometheus / waitForQueryLog

Function waitForQueryLog

cmd/prometheus/query_log_test.go:455–463  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

453// waitForQueryLog waits for the query log to contain at least minEntries entries,
454// polling at regular intervals until the timeout is reached.
455func 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
465func TestQueryLog(t *testing.T) {
466 if testing.Short() {

Callers 1

runMethod · 0.85

Calls 1

readQueryLogFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…