diff --git a/p2p/transport/testsuite/stream_suite.go b/p2p/transport/testsuite/stream_suite.go index e7770bfa7..7056dbf1d 100644 --- a/p2p/transport/testsuite/stream_suite.go +++ b/p2p/transport/testsuite/stream_suite.go @@ -7,6 +7,7 @@ import ( "io" "io/ioutil" "os" + "runtime" "strconv" "sync" "testing" @@ -417,9 +418,15 @@ func SubtestStress1Conn100Stream100Msg(t *testing.T, ta, tb transport.Transport, }) } -func SubtestStress50Conn10Stream50Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { +func SubtestStressManyConn10Stream50Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) { + connNum := 5 + if runtime.GOOS == "linux" { + // Linux can handle a higher number of conns here than other platforms in CI. + // See https://github.com/libp2p/go-libp2p/issues/1498. + connNum = 50 + } SubtestStress(t, ta, tb, maddr, peerA, Options{ - ConnNum: 50, + ConnNum: connNum, StreamNum: 10, MsgNum: 50, MsgMax: 100, diff --git a/p2p/transport/testsuite/utils_suite.go b/p2p/transport/testsuite/utils_suite.go index 1d520ff26..201d43d9d 100644 --- a/p2p/transport/testsuite/utils_suite.go +++ b/p2p/transport/testsuite/utils_suite.go @@ -21,7 +21,7 @@ var Subtests = []func(t *testing.T, ta, tb transport.Transport, maddr ma.Multiad SubtestStress1Conn1Stream1Msg, SubtestStress1Conn1Stream100Msg, SubtestStress1Conn100Stream100Msg, - SubtestStress50Conn10Stream50Msg, + SubtestStressManyConn10Stream50Msg, SubtestStress1Conn1000Stream10Msg, SubtestStress1Conn100Stream100Msg10MB, SubtestStreamOpenStress, @@ -37,6 +37,7 @@ func SubtestTransport(t *testing.T, ta, tb transport.Transport, addr string, pee if err != nil { t.Fatal(err) } + for _, f := range Subtests { t.Run(getFunctionName(f), func(t *testing.T) { f(t, ta, tb, maddr, peerA)