Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not skip service/operation indexing for firehose spans + a couple fixes #2090

Merged
merged 6 commits into from
Feb 27, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix flaky test
Signed-off-by: Yuri Shkuro <ys@uber.com>
  • Loading branch information
Yuri Shkuro committed Feb 27, 2020
commit 1e1cbd524b2177737bd696d5bd2b96d1ed5e0d30
7 changes: 4 additions & 3 deletions cmd/agent/app/reporter/client_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,16 @@ func TestClientMetricsReporter_Expire(t *testing.T) {
t.Run(fmt.Sprintf("iter%d:gauge=%d,log=%s", i, test.expGauge, test.expLog), func(t *testing.T) {
// Expire loop runs every 100us, and removes the client after 5ms.
// We check for condition in each test for up to 5ms (10*500us).
var gaugeValue int64 = -1
for i := 0; i < 10; i++ {
_, gauges := tr.mb.Snapshot()
if gauges["client_stats.connected_clients"] == int64(test.expGauge) {
gaugeValue = gauges["client_stats.connected_clients"]
if gaugeValue == int64(test.expGauge) {
break
}
time.Sleep(500 * time.Microsecond)
}
tr.mb.AssertGaugeMetrics(t,
metricstest.ExpectedMetric{Name: "client_stats.connected_clients", Value: test.expGauge})
assert.EqualValues(t, test.expGauge, gaugeValue)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change to fix a flaky test. There was a race condition with gauge value being 1 inside the loop and then dropping back to 0 by the time the AssertGaugeMetrics was called.

tr.assertLog(t, test.expLog, clientUUID)

// sleep between tests long enough to exceed the 5ms TTL.
Expand Down