MCPcopy
hub / github.com/dgraph-io/dgraph / TestHealth

Function TestHealth

dgraph/cmd/alpha/http_test.go:815–828  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

813}
814
815func TestHealth(t *testing.T) {
816 url := fmt.Sprintf("%s/health", addr)
817 resp, err := http.Get(url)
818 require.NoError(t, err)
819
820 defer resp.Body.Close()
821 data, err := io.ReadAll(resp.Body)
822 require.NoError(t, err)
823
824 var info []pb.HealthInfo
825 require.NoError(t, json.Unmarshal(data, &info))
826 require.Equal(t, "alpha", info[0].Instance)
827 require.True(t, info[0].Uptime > int64(time.Duration(1)))
828}
829
830// TestCmdlineEndpointsNotExposed ensures that endpoints which expose the full
831// process command line are not reachable without authentication. Both

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected