summaryrefslogtreecommitdiff
path: root/integrationtests/dtailhealth_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/dtailhealth_test.go')
-rw-r--r--integrationtests/dtailhealth_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/integrationtests/dtailhealth_test.go b/integrationtests/dtailhealth_test.go
index 0dc177c..271f11d 100644
--- a/integrationtests/dtailhealth_test.go
+++ b/integrationtests/dtailhealth_test.go
@@ -62,7 +62,9 @@ func TestDTailHealthCheck3(t *testing.T) {
return
}
stdoutFile := "dtailhealth3.stdout.tmp"
- expectedStdoutFile := "dtailhealth3.expected"
+ port := getUniquePortNumber()
+ bindAddress := "localhost"
+ expectedOut := fmt.Sprintf("OK: All fine at %s:%d :-)", bindAddress, port)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -72,23 +74,22 @@ func TestDTailHealthCheck3(t *testing.T) {
"--cfg", "none",
"--logger", "stdout",
"--logLevel", "trace",
- "--bindAddress", "localhost",
- "--port", "4242",
+ "--bindAddress", bindAddress,
+ "--port", fmt.Sprintf("%d", port),
)
if err != nil {
t.Error(err)
return
}
- // TODO: Get unique test port number.
_, err = runCommandRetry(ctx, t, 10, stdoutFile,
- "../dtailhealth", "--server", "localhost:4242")
+ "../dtailhealth", "--server", fmt.Sprintf("%s:%d", bindAddress, port))
if err != nil {
t.Error(err)
return
}
- if err := compareFiles(t, stdoutFile, expectedStdoutFile); err != nil {
+ if err := fileContainsStr(t, stdoutFile, expectedOut); err != nil {
t.Error(err)
return
}