diff --git a/end-to-end/utils_test.go b/end-to-end/utils_test.go index c493711db..5043e5fc5 100644 --- a/end-to-end/utils_test.go +++ b/end-to-end/utils_test.go @@ -154,14 +154,20 @@ func stopAgent(ctx context.Context) error { func distroIsProAttached(t *testing.T, ctx context.Context, d gowsl.Distro) (bool, error) { t.Helper() - out, err := d.Command(ctx, "pro status --format=json").Output() - if err != nil { - return false, fmt.Errorf("could not call pro status: %v. %s", err, out) + var stdout, stderr bytes.Buffer + + cmd := d.Command(ctx, "pro status --format=json") + cmd.Stdout = &stdout + cmd.Stderr = &stderr + + if err := cmd.Run(); err != nil { + return false, fmt.Errorf("could not call pro status: %v.\nSTDOUT: %s\nSTDERR: %s", err, &stdout, &stderr) } var response struct { Attached bool } + out := stdout.Bytes() if err := json.Unmarshal(out, &response); err != nil { return false, fmt.Errorf("could not parse pro status response: %v: %s", err, out) }