Skip to content

Commit 08e2e54

Browse files
committed
add test
Signed-off-by: Yuri Shkuro <github@ysh.us>
1 parent 4e662be commit 08e2e54

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/agent/app/reporter/connect_metrics_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,8 @@ func TestConnectMetrics(t *testing.T) {
5353

5454
cm.RecordTarget("collector-host")
5555
assert.Equal(t, `"collector-host"`, expvar.Get("gRPCTarget").String())
56+
57+
// since expvars are singletons, the second constructor should grab the same var
58+
cm2 := NewConnectMetrics(mf)
59+
assert.Same(t, cm.target, cm2.target)
5660
}

0 commit comments

Comments
 (0)