open-consul/connect
Daniel Nephin 03aa6106ff connect/proxy: fix a number of problems with Listener
We noticed that TestUpstreamListener would deadlock sometimes when run
with the race detector. While debugging this issue I found and fixed the
following problems.

1. the net.Listener was not being closed properly when Listener.Stop was
   called. This caused the Listener.Serve goroutine to run forever.
   Fixed by storing a reference to net.Listener and closing it properly
   when Listener.Stop is called.
2. call connWG.Add in the correct place. WaitGroup.Add must be called
   before starting a goroutine, not from inside the goroutine.
3. Set metrics config EnableRuntimeMetrics to `false` so that we don't
   start a background goroutine in each test for no reason. There is no
   way to shutdown this goroutine, and it was an added distraction while
   debugging these timeouts.
5. two tests were calling require.NoError from a goroutine.
   require.NoError calls t.FailNow, which MUST be called from the main
   test goroutine. Instead use t.Errorf, which can be called from other
   goroutines and will still fail the test.
6. `assertCurrentGaugeValue` wass breaking out of a for loop, which
   would cause the `RWMutex.RUnlock` to be missed. Fixed by calling
   unlock before `break`.

The core issue of a deadlock  was fixed by https://github.com/armon/go-metrics/pull/124.
2021-04-28 17:21:35 -04:00
..
certgen Fix support for RSA CA keys in Connect. (#6638) 2019-11-01 13:20:26 +00:00
proxy connect/proxy: fix a number of problems with Listener 2021-04-28 17:21:35 -04:00
example_test.go connect.Service based implementation after review feedback. 2018-06-14 09:41:56 -07:00
resolver.go Ensure Consul is IPv6 compliant (#5468) 2019-06-04 10:02:38 -04:00
resolver_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
service.go Allow passing ALPN next protocols down to connect services. Fixes #4466. (#9920) 2021-03-26 11:34:47 +00:00
service_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
testing.go ci: go-test-race switch to exclude list 2020-11-11 14:44:57 -05:00
tls.go ci: go-test-race switch to exclude list 2020-11-11 14:44:57 -05:00
tls_test.go connect: fix test for go1.16 2021-04-13 13:25:45 -04:00