Skip to content

Commit 28128e0

Browse files
authored
xdsclient: Fix flakyness in TestResourceUpdateMetrics in the case of repeated NACKs (#8363)
1 parent 4cab0e6 commit 28128e0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

xds/internal/clients/xdsclient/test/helpers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,5 +296,5 @@ func (r *testMetricsReporter) waitForMetric(ctx context.Context, metricsDataWant
296296

297297
// ReportMetric sends the metrics data to the metricsCh channel.
298298
func (r *testMetricsReporter) ReportMetric(m any) {
299-
r.metricsCh.Send(m)
299+
r.metricsCh.Replace(m)
300300
}

xds/internal/clients/xdsclient/test/metrics_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import (
4040
// to send valid and invalid LDS updates, and verifies that the expected metrics
4141
// for both good and bad updates are emitted.
4242
func (s) TestResourceUpdateMetrics(t *testing.T) {
43-
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout*1000)
43+
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
4444
defer cancel()
4545

4646
tmr := newTestMetricsReporter()

0 commit comments

Comments
 (0)