Skip to content

Commit

Permalink
Merge pull request etcd-io#16692 from serathius/getformat
Browse files Browse the repository at this point in the history
Avoid timing out and provide a proper error in TestCtlV3GetFormat test
  • Loading branch information
serathius committed Oct 5, 2023
2 parents 0f14106 + f3196e3 commit 24b6796
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/e2e/ctl_v3_kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ package e2e
import (
"context"
"fmt"
"strings"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"go.etcd.io/etcd/pkg/v3/expect"
Expand Down Expand Up @@ -179,9 +181,11 @@ func getFormatTest(cx ctlCtx) {
cmdArgs = append(cmdArgs, "--print-value-only")
}
cmdArgs = append(cmdArgs, "abc")
if err := e2e.SpawnWithExpectWithEnv(cmdArgs, cx.envMap, expect.ExpectedResponse{Value: tt.wstr}); err != nil {
cx.t.Errorf("#%d: error (%v), wanted %v", i, err, tt.wstr)
lines, err := e2e.RunUtilCompletion(cmdArgs, cx.envMap)
if err != nil {
cx.t.Errorf("#%d: error (%v)", i, err)
}
assert.Contains(cx.t, strings.Join(lines, "\n"), tt.wstr)
}
}

Expand Down

0 comments on commit 24b6796

Please sign in to comment.