fix the test

This commit is contained in:
Krasi Georgiev 2018-01-16 11:25:52 +00:00
parent 5260c650ec
commit 87a8fc24d5
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@ package notifier
import (
"context"
"crypto/md5"
"encoding/json"
"fmt"
"io/ioutil"
@ -487,7 +488,11 @@ alerting:
tgs := make(map[string][]*targetgroup.Group)
for _, tt := range tests {
tgs[fmt.Sprintf("%p", cfg.AlertingConfig.AlertmanagerConfigs[0])] = []*targetgroup.Group{
b, err := json.Marshal(cfg.AlertingConfig.AlertmanagerConfigs[0])
if err != nil {
t.Fatalf("Error creating config hash:%v", err)
}
tgs[fmt.Sprintf("%x", md5.Sum(b))] = []*targetgroup.Group{
tt.in,
}
n.reload(tgs)