Skip to content

Commit

Permalink
Close nodes. Remove mplex
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Aug 10, 2023
1 parent e651dd4 commit cd34a6b
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions p2p/test/transport/deadline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package transport_integration

import (
"context"
"strings"
"testing"
"time"

Expand All @@ -18,7 +17,9 @@ func TestReadWriteDeadlines(t *testing.T) {
for _, tc := range transportsToTest {
t.Run(tc.Name, func(t *testing.T) {
listener := tc.HostGenerator(t, TransportTestCaseOpts{})
defer listener.Close()
dialer := tc.HostGenerator(t, TransportTestCaseOpts{NoListen: true})
defer dialer.Close()

require.NoError(t, dialer.Connect(context.Background(), peer.AddrInfo{
ID: listener.ID(),
Expand All @@ -44,11 +45,6 @@ func TestReadWriteDeadlines(t *testing.T) {
require.Error(t, err)
require.Contains(t, err.Error(), "deadline")
require.Less(t, time.Since(start), 1*time.Second)

if strings.Contains(tc.Name, "mplex") {
// FIXME: mplex stalls on close, so we reset so we don't spend an extra 5s waiting for nothing
s.Reset()
}
})

t.Run("WriteDeadline", func(t *testing.T) {
Expand All @@ -63,11 +59,6 @@ func TestReadWriteDeadlines(t *testing.T) {
require.Error(t, err)
require.Contains(t, err.Error(), "deadline")
require.Less(t, time.Since(start), 1*time.Second)

if strings.Contains(tc.Name, "mplex") {
// FIXME: mplex stalls on close, so we reset so we don't spend an extra 5s waiting for nothing
s.Reset()
}
})

// Like the above, but with SetDeadline
Expand All @@ -91,11 +82,6 @@ func TestReadWriteDeadlines(t *testing.T) {
require.Error(t, err)
require.Contains(t, err.Error(), "deadline")
require.Less(t, time.Since(start), 1*time.Second)

if strings.Contains(tc.Name, "mplex") {
// FIXME: mplex stalls on close, so we reset so we don't spend an extra 5s waiting for nothing
s.Reset()
}
})
}
})
Expand Down

0 comments on commit cd34a6b

Please sign in to comment.