diff options
| author | Paul Buetow <paul@buetow.org> | 2021-10-09 21:10:29 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-10-10 13:36:41 +0300 |
| commit | 97747ea0f3178f7f5890512d483fdccaa82846b0 (patch) | |
| tree | 9ff1335ca26afc90e55fd6de416457e252d75a35 /integrationtests/dtailhealthcheck_test.go | |
| parent | 7a7169791a64190e1002e38bc9c04ad0d5c1ce1f (diff) | |
vetting and linting and some code restyling
Diffstat (limited to 'integrationtests/dtailhealthcheck_test.go')
| -rw-r--r-- | integrationtests/dtailhealthcheck_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/integrationtests/dtailhealthcheck_test.go b/integrationtests/dtailhealthcheck_test.go index 97fa5f2..d562239 100644 --- a/integrationtests/dtailhealthcheck_test.go +++ b/integrationtests/dtailhealthcheck_test.go @@ -30,9 +30,10 @@ func TestDTailHealthCheck(t *testing.T) { func TestDTailHealthCheck2(t *testing.T) { stdoutFile := "dtailhealthcheck2.stdout.tmp" expectedStdoutFile := "dtailhealthcheck2.expected" + args := []string{"--server", "example:1"} t.Log("Negative test, is supposed to exit with a critical state.") - exitCode, err := runCommand(t, "../dtailhealthcheck", []string{"--server", "example:1"}, stdoutFile) + exitCode, err := runCommand(t, "../dtailhealthcheck", args, stdoutFile) if exitCode != 2 { t.Error(fmt.Sprintf("Expected exit code '2' but got '%d': %v", exitCode, err)) return @@ -55,16 +56,17 @@ func TestDTailHealthCheck3(t *testing.T) { defer cancel() go func() { - serverArgs := []string{"--logger", "stdout", "--logLevel", "trace", "--port", "4242"} - runCommandContext(t, ctx, "../dserver", serverArgs, serverStdoutFile) + args := []string{"--logger", "stdout", "--logLevel", "trace", "--port", "4242"} + runCommandContext(ctx, t, "../dserver", args, serverStdoutFile) }() var err error + args := []string{"--server", "localhost:4242"} for i := 0; i < 30; i++ { t.Log("Waiting for dserver to start", i) time.Sleep(time.Second) var exitCode int - if exitCode, err = runCommand(t, "../dtailhealthcheck", []string{"--server", "localhost:4242"}, stdoutFile); exitCode == 0 { + if exitCode, err = runCommand(t, "../dtailhealthcheck", args, stdoutFile); exitCode == 0 { break } } |
