mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-09 14:26:13 +02:00
Merge pull request #18416 from roidelapluie/roidelapluie/rules-alerting-test-debug
rules: add goroutine dump and increase timeout in template test
This commit is contained in:
commit
9899ab3706
@ -16,6 +16,7 @@ package rules
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -538,8 +539,11 @@ instance: {{ $v.Labels.instance }}, value: {{ printf "%.0f" $v.Value }};
|
||||
close(startQueryCh)
|
||||
select {
|
||||
case <-getDoneCh:
|
||||
case <-time.After(time.Millisecond * 10):
|
||||
case <-time.After(20 * time.Millisecond):
|
||||
// Assert no blocking when template expanding.
|
||||
buf := make([]byte, 1<<20)
|
||||
n := runtime.Stack(buf, true)
|
||||
t.Logf("goroutine dump:\n%s", buf[:n])
|
||||
require.Fail(t, "unexpected blocking when template expanding.")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user