Skip to content

Commit

Permalink
Merge #117137
Browse files Browse the repository at this point in the history
117137: cli: remove `t` field from `TestCLI` usage r=abarganier a=dhartunian

Currently, these tests fail in CI with a nil pointer at runtime when we call `c.t.Fail` when an error is produced.

This change removes the sharing of the `t` variable with `TestCLI` since it seems to result in a conflict between the outer test code and what runs inside `RunWithCapture`.

I was unable to reproduce the error locally and do not have further clues. My hope is that, the simplified error handling will surface the actual error in CI instead of the continued nil pointer exception.

Resolves: #116228
Epic: None
Release note: None

Co-authored-by: David Hartunian <[email protected]>
  • Loading branch information
craig[bot] and dhartunian committed Dec 28, 2023
2 parents 66c2dc6 + 1c9d761 commit d0760e6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pkg/cli/zip_test.go
Original file line number Diff line number Diff line change
@@ -434,15 +434,12 @@ func TestUnavailableZip(t *testing.T) {

t.Run("server 1", func(t *testing.T) {
c := TestCLI{
t: t,
Server: tc.Server(0),
Insecure: true,
}

out, err := c.RunWithCapture(debugZipCommand)
if err != nil {
c.fail(err)
}
require.NoError(t, err)

// Assert debug zip output for cluster, node 1, node 2, node 3.
assert.NotEmpty(t, out)
@@ -470,15 +467,12 @@ func TestUnavailableZip(t *testing.T) {
t.Run("server 2", func(t *testing.T) {
// Run debug zip against node 2.
c := TestCLI{
t: t,
Server: tc.Server(1),
Insecure: true,
}

out, err := c.RunWithCapture(debugZipCommand)
if err != nil {
c.fail(err)
}
require.NoError(t, err)

// Assert debug zip output for cluster, node 2.
assert.NotEmpty(t, out)

0 comments on commit d0760e6

Please sign in to comment.