Deflakes TestConnect; this previously would sometimes finish before the conn_end metric was published, which would cause the test to fail. I've addressed this by having the test block on both ConnectionClosed & the metric Count calls being hit - these two are async wrt each other, so blocking on just one or the other is insufficient.
While trying to merge this, I also ran into another flake in TestAddSingleWithFailure. I've fixed this one as well - it's not entirely clear why we ever would have needed the assert.Eventually call here. Simply calling Wait() is faster and isn't flaky.
Motivation
Reduce toil from flaky tests.
Test plan
go test ./proxy/connect ./proxy/destinations -count 1000; this fails on master.
Summary
Deflakes
TestConnect
; this previously would sometimes finish before theconn_end
metric was published, which would cause the test to fail. I've addressed this by having the test block on bothConnectionClosed
& the metricCount
calls being hit - these two are async wrt each other, so blocking on just one or the other is insufficient.While trying to merge this, I also ran into another flake in
TestAddSingleWithFailure
. I've fixed this one as well - it's not entirely clear why we ever would have needed theassert.Eventually
call here. Simply callingWait()
is faster and isn't flaky.Motivation
Reduce toil from flaky tests.
Test plan
go test ./proxy/connect ./proxy/destinations -count 1000
; this fails on master.