| 813 | } |
| 814 | |
| 815 | func 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 |