fix: expvar error when observatory is not enabled & various typos

This commit is contained in:
yichya 2022-04-01 16:38:27 +08:00 committed by yuhan6665
parent 70306c4ec8
commit 755268b7d4
4 changed files with 12 additions and 7 deletions

View file

@ -1,6 +1,7 @@
package scenarios
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
@ -99,7 +100,8 @@ func TestMetrics(t *testing.T) {
if err2 != nil {
t.Fatal(err2)
}
if string(body2)[0] != '{' {
var json2 map[string]interface{}
if json.Unmarshal(body2, &json2) != nil {
t.Error("unexpected response body from expvars handler")
}
}