Skip to content

Commit

Permalink
Fixing the test
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiojmendes committed Apr 27, 2022
1 parent 5bff434 commit 1e41f7e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/kaf/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package main

import (
"bytes"
"context"
"io"
"io/ioutil"
"os"
"testing"
"time"

"github.com/orlangure/gnomock"
"github.com/orlangure/gnomock/preset/kafka"
Expand Down Expand Up @@ -42,8 +40,8 @@ func testMain(m *testing.M) (code int) {
}

func runCmd(t *testing.T, in io.Reader, args ...string) string {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
defer cancel()
// ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
// defer cancel()

b := bytes.NewBufferString("")

Expand All @@ -52,7 +50,7 @@ func runCmd(t *testing.T, in io.Reader, args ...string) string {
rootCmd.SetErr(b)
rootCmd.SetIn(in)

require.NoError(t, rootCmd.ExecuteContext(ctx))
require.NoError(t, rootCmd.Execute())

bs, err := ioutil.ReadAll(b)
require.NoError(t, err)
Expand Down

0 comments on commit 1e41f7e

Please # to comment.