Skip to content

Commit

Permalink
Only run the 50 connection test on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed May 18, 2022
1 parent 5d8f1d7 commit f850a6f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions p2p/transport/testsuite/stream_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,16 @@ func SubtestStress50Conn10Stream50Msg(t *testing.T, ta, tb transport.Transport,
})
}

func SubtestStress5Conn10Stream50Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) {
SubtestStress(t, ta, tb, maddr, peerA, Options{
ConnNum: 5,
StreamNum: 10,
MsgNum: 50,
MsgMax: 100,
MsgMin: 100,
})
}

func SubtestStress1Conn1000Stream10Msg(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) {
SubtestStress(t, ta, tb, maddr, peerA, Options{
ConnNum: 1,
Expand Down
10 changes: 9 additions & 1 deletion p2p/transport/testsuite/utils_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var Subtests = []func(t *testing.T, ta, tb transport.Transport, maddr ma.Multiad
SubtestStress1Conn1Stream1Msg,
SubtestStress1Conn1Stream100Msg,
SubtestStress1Conn100Stream100Msg,
SubtestStress50Conn10Stream50Msg,
SubtestStress5Conn10Stream50Msg,
SubtestStress1Conn1000Stream10Msg,
SubtestStress1Conn100Stream100Msg10MB,
SubtestStreamOpenStress,
Expand All @@ -37,6 +37,14 @@ func SubtestTransport(t *testing.T, ta, tb transport.Transport, addr string, pee
if err != nil {
t.Fatal(err)
}

if runtime.GOOS == "linux" {
// Only run this test on Linux since macOS runs into buffering issues on CI
// with this many connections. See
// https://github.com/libp2p/go-libp2p/issues/1498.
Subtests = append(Subtests, SubtestStress50Conn10Stream50Msg)
}

for _, f := range Subtests {
t.Run(getFunctionName(f), func(t *testing.T) {
f(t, ta, tb, maddr, peerA)
Expand Down

0 comments on commit f850a6f

Please sign in to comment.