Skip to content

Commit

Permalink
Merge pull request #16 from iand/fix/repo-cleanup
Browse files Browse the repository at this point in the history
chore: skip slow tests when short testing is specified
  • Loading branch information
Stebalien authored Jul 19, 2021
2 parents 6ef4644 + 5a058db commit e6db3c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
)

func TestBasic(t *testing.T) {
if testing.Short() {
t.Skip("short testing requested")
}
var wg sync.WaitGroup
wg.Add(100)
for i := 0; i < 100; i++ {
Expand Down Expand Up @@ -52,6 +55,9 @@ func TestBasic(t *testing.T) {
}

func TestShared(t *testing.T) {
if testing.Short() {
t.Skip("short testing requested")
}
var wg sync.WaitGroup
wg.Add(20 * 21)
for i := 0; i < 20; i++ {
Expand Down Expand Up @@ -102,6 +108,9 @@ func TestShared(t *testing.T) {
}

func TestUnregister(t *testing.T) {
if testing.Short() {
t.Skip("short testing requested")
}
var wg sync.WaitGroup
wg.Add(100 * 2)
for i := 0; i < 100; i++ {
Expand Down
5 changes: 4 additions & 1 deletion sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (

// regression test for libp2p/go-libp2p-core#65
func TestIdleInconsistency(t *testing.T) {
if testing.Short() {
t.Skip("short testing requested")
}

r := new(MeterRegistry)
m1 := r.Get("first")
m2 := r.Get("second")
Expand Down Expand Up @@ -40,5 +44,4 @@ func TestIdleInconsistency(t *testing.T) {
if total := r.Get("third").Snapshot().Total; total != 50 {
t.Errorf("expected third total to be 50, got %d", total)
}

}

0 comments on commit e6db3c8

Please sign in to comment.