Skip to content

Commit

Permalink
Fix flaky TestIntrospectNumConnections
Browse files Browse the repository at this point in the history
See failure:
https://travis-ci.org/uber/tchannel-go/jobs/205167194

Test pings from new clients to a server, and verifies the number of
connections the server should have. The test is flaky since we don't add
connections to the internal connection list before we start the
read/write goroutines on the connection, so we can end up processing
pings/calls on a connection before we've added the connection to the
list.
  • Loading branch information
prashantv committed Feb 25, 2017
1 parent 3abb4c0 commit e5bf98f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions connection.go
Expand Up @@ -281,10 +281,11 @@ func (ch *Channel) newConnection(conn net.Conn, outboundHP string, remotePeer Pe
c.relay = NewRelayer(ch, c)
}

go c.readFrames(connID)
go c.writeFrames(connID)
// Connections are activated as soon as they are created.
c.callOnActive()

go c.readFrames(connID)
go c.writeFrames(connID)
return c
}

Expand Down

0 comments on commit e5bf98f

Please sign in to comment.