Browse Source

chore: replace hardcoded node name with a constant (#16692)

pull/16695/head^2
cskh 2 years ago committed by GitHub
parent
commit
2f13f75d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      api/health_test.go

5
api/health_test.go

@ -192,8 +192,9 @@ func TestAPI_HealthChecks_AggregatedStatus(t *testing.T) {
func TestAPI_HealthChecks(t *testing.T) { func TestAPI_HealthChecks(t *testing.T) {
t.Parallel() t.Parallel()
const nodename = "node123"
c, s := makeClientWithConfig(t, nil, func(conf *testutil.TestServerConfig) { c, s := makeClientWithConfig(t, nil, func(conf *testutil.TestServerConfig) {
conf.NodeName = "node123" conf.NodeName = nodename
}) })
defer s.Stop() defer s.Stop()
@ -215,7 +216,7 @@ func TestAPI_HealthChecks(t *testing.T) {
retry.Run(t, func(r *retry.R) { retry.Run(t, func(r *retry.R) {
checks := HealthChecks{ checks := HealthChecks{
&HealthCheck{ &HealthCheck{
Node: "node123", Node: nodename,
CheckID: "service:foo", CheckID: "service:foo",
Name: "Service 'foo' check", Name: "Service 'foo' check",
Status: "critical", Status: "critical",

Loading…
Cancel
Save