Skip to content

Commit

Permalink
flyby: use idiomatic testing env check [APP-2917]
Browse files Browse the repository at this point in the history
  • Loading branch information
maximpertsov committed Aug 20, 2024
1 parent e2243e1 commit bbc5e4c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions robot/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ package client
import (
"context"
"errors"
"flag"
"fmt"
"io"
"strings"
"sync"
"sync/atomic"
"testing"
"time"

"github.com/fullstorydev/grpcurl"
Expand Down Expand Up @@ -583,10 +583,7 @@ func (rc *RobotClient) resources(ctx context.Context) ([]resource.Status, []reso
// pauses for longer than 5s, below calls to ResourceNames or
// ResourceRPCSubtypes can result in context errors that appear in client.New
// and remote logic.
//
// TODO(APP-2917): Once we upgrade to go 1.21, replace this if check with if
// !testing.Testing().
if flag.Lookup("test.v") == nil {
if !testing.Testing() {
var cancel func()
ctx, cancel = contextutils.ContextWithTimeoutIfNoDeadline(ctx, defaultResourcesTimeout)
defer cancel()
Expand Down

0 comments on commit bbc5e4c

Please sign in to comment.