Revert "Revert "Don't take the proxy mutex in the traffic path""

This commit is contained in:
Daniel Smith
2015-09-01 16:40:11 -07:00
parent fa9339d9e4
commit 9fc8a79e37
3 changed files with 24 additions and 3 deletions

View File

@@ -429,6 +429,9 @@ func TestTCPProxyStop(t *testing.T) {
if err != nil {
t.Fatalf("error adding new service: %#v", err)
}
if !svcInfo.isAlive() {
t.Fatalf("wrong value for isAlive(): expected true")
}
conn, err := net.Dial("tcp", joinHostPort("", svcInfo.proxyPort))
if err != nil {
t.Fatalf("error connecting to proxy: %v", err)
@@ -437,6 +440,9 @@ func TestTCPProxyStop(t *testing.T) {
waitForNumProxyLoops(t, p, 1)
stopProxyByName(p, service)
if svcInfo.isAlive() {
t.Fatalf("wrong value for isAlive(): expected false")
}
// Wait for the port to really close.
if err := waitForClosedPortTCP(p, svcInfo.proxyPort); err != nil {
t.Fatalf(err.Error())