Fix minor issues after applying analyzer "modernize"
- The tool left an empty line behind that we don't need anymore, see https://github.com/prometheus/prometheus/pull/17092. (Arguably not a bug in the tool but just our stricter style about empty lines.) - In tsdb/index/postings_test.go , our (admittedly somewhat convoluted) code structure tricked the tool so it spit out something that wouldn't even compile. - storage/remote/queue_manager_test.go is just a minor formatting nit. Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
747c5ee2b1
commit
71c21fb9e4
|
@ -2479,7 +2479,6 @@ func TestBoundedRuleEvalConcurrency(t *testing.T) {
|
||||||
// Evaluate groups concurrently (like they normally do).
|
// Evaluate groups concurrently (like they normally do).
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
for _, group := range groups {
|
for _, group := range groups {
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
group.Eval(ctx, time.Now())
|
group.Eval(ctx, time.Now())
|
||||||
|
|
|
@ -1596,7 +1596,9 @@ func TestCalculateDesiredShards(t *testing.T) {
|
||||||
|
|
||||||
sout := min(
|
sout := min(
|
||||||
// You can't send samples that don't exist so cap at the number of pending samples.
|
// You can't send samples that don't exist so cap at the number of pending samples.
|
||||||
int64(m.numShards*cfg.MaxSamplesPerSend)*int64(shardUpdateDuration/(100*time.Millisecond)), pendingSamples)
|
int64(m.numShards*cfg.MaxSamplesPerSend)*int64(shardUpdateDuration/(100*time.Millisecond)),
|
||||||
|
pendingSamples,
|
||||||
|
)
|
||||||
sendSamples(sout, ts)
|
sendSamples(sout, ts)
|
||||||
|
|
||||||
t.Log("desiredShards", m.numShards, "pendingSamples", pendingSamples)
|
t.Log("desiredShards", m.numShards, "pendingSamples", pendingSamples)
|
||||||
|
|
|
@ -642,8 +642,7 @@ func TestRemovedNextStackoverflow(t *testing.T) {
|
||||||
var full []storage.SeriesRef
|
var full []storage.SeriesRef
|
||||||
var remove []storage.SeriesRef
|
var remove []storage.SeriesRef
|
||||||
|
|
||||||
var i storage.SeriesRef
|
for i := range storage.SeriesRef(1e7) {
|
||||||
for i = range github.com / prometheus / prometheus / storage.SeriesRef(1e7) {
|
|
||||||
full = append(full, i)
|
full = append(full, i)
|
||||||
remove = append(remove, i)
|
remove = append(remove, i)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue