Skip to content

Commit

Permalink
Remote relay codepath for TestRemotePeer
Browse files Browse the repository at this point in the history
Testing this codepath gets very specific to the relay logic, and is
covered by TestRelayOutgoingConnectionsEphemeral
  • Loading branch information
prashantv committed Jun 29, 2016
1 parent 567074d commit c92b4a3
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions connection_test.go
Expand Up @@ -162,16 +162,6 @@ func TestRemotePeer(t *testing.T) {
name: "ephemeral client",
remote: func(ts *testutils.TestServer) *Channel { return ts.NewClient(nil) },
expectedFn: func(state *RuntimeState, ts *testutils.TestServer) PeerInfo {
if ts.HasRelay() {
// The server should see a call from the relay. Connections from relays
// to the receiving service shouldn't be ephemeral.
relayInfo := ts.Relay().PeerInfo()
return PeerInfo{
HostPort: relayInfo.HostPort,
IsEphemeral: false,
ProcessName: relayInfo.ProcessName,
}
}
return PeerInfo{
HostPort: state.RootPeers[ts.HostPort()].OutboundConnections[0].LocalHostPort,
IsEphemeral: true,
Expand All @@ -183,15 +173,6 @@ func TestRemotePeer(t *testing.T) {
name: "listening server",
remote: func(ts *testutils.TestServer) *Channel { return ts.NewServer(nil) },
expectedFn: func(state *RuntimeState, ts *testutils.TestServer) PeerInfo {
if ts.HasRelay() {
// Same as above.
relayInfo := ts.Relay().PeerInfo()
return PeerInfo{
HostPort: relayInfo.HostPort,
IsEphemeral: false,
ProcessName: relayInfo.ProcessName,
}
}
return PeerInfo{
HostPort: state.LocalPeer.HostPort,
IsEphemeral: false,
Expand All @@ -205,7 +186,7 @@ func TestRemotePeer(t *testing.T) {
defer cancel()

for _, tt := range tests {
opts := testutils.NewOpts().SetServiceName("fake-service")
opts := testutils.NewOpts().SetServiceName("fake-service").NoRelay()
testutils.WithTestServer(t, opts, func(ts *testutils.TestServer) {
remote := tt.remote(ts)
defer remote.Close()
Expand Down

0 comments on commit c92b4a3

Please sign in to comment.