Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Remove dependency on travis package from go-libp2p-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Jul 1, 2022
1 parent 80e319f commit a02a3be
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bitswap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"os"
"sync"
"testing"
"time"
Expand All @@ -25,10 +26,14 @@ import (
ipld "github.com/ipfs/go-ipld-format"
peer "github.com/libp2p/go-libp2p-core/peer"
p2ptestutil "github.com/libp2p/go-libp2p-netutil"
travis "github.com/libp2p/go-libp2p-testing/ci/travis"
tu "github.com/libp2p/go-libp2p-testing/etc"
)

func isCI() bool {
// https://github.blog/changelog/2020-04-15-github-actions-sets-the-ci-environment-variable-to-true/
return os.Getenv("CI") != ""
}

// FIXME the tests are really sensitive to the network delay. fix them to work
// well under varying conditions
const kNetworkDelay = 0 * time.Millisecond
Expand Down Expand Up @@ -248,7 +253,7 @@ func TestLargeSwarm(t *testing.T) {
// when running with the race detector, 500 instances launches
// well over 8k goroutines. This hits a race detector limit.
numInstances = 20
} else if travis.IsRunning() {
} else if isCI() {
numInstances = 200
} else {
t.Parallel()
Expand All @@ -261,7 +266,7 @@ func TestLargeFile(t *testing.T) {
t.SkipNow()
}

if !travis.IsRunning() {
if !isCI() {
t.Parallel()
}

Expand Down

0 comments on commit a02a3be

Please sign in to comment.