Skip to content

Commit

Permalink
Merge pull request #859 from google/exec-test
Browse files Browse the repository at this point in the history
test: Add extra debugging to the exec test.
  • Loading branch information
jaqx0r authored May 6, 2024
2 parents 47d3a6d + cdc20a9 commit c1e84ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/mtail/exec_integration_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Google Inc. ll Rights Reserved.
// Copyright 2024 Google Inc. All Rights Reserved.
// This file is available under the Apache license.

package mtail_test
Expand All @@ -9,6 +9,7 @@ import (
"fmt"
"os/exec"
"path/filepath"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -39,13 +40,19 @@ func TestExecMtail(t *testing.T) {
"-progs",
"../../examples",
"-logs", "testdata/rsyncd.log",
"--logtostderr",
"--v=2",
"-one_shot",
"-one_shot_format=prometheus",
"-port", fmt.Sprintf("%d", testutil.FreePort(t)),
}
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, mtailPath, cs...)
cmd.Cancel = func() error {
// Kill with abort to dump stack
return cmd.Process.Signal(syscall.SIGABRT)
}
if out, err := cmd.CombinedOutput(); err != nil {
t.Logf("%s", out)
t.Error(err)
Expand Down

0 comments on commit c1e84ca

Please sign in to comment.