Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1f59aa

Browse files
authored
fix: stop checking gauges unrelated to TestAgent_Stats_Magic (#17290)
Fixescoder/internal#564The test is asserting too much, including stats guages that are not directly related to the thing we are trying to test: ConnectionCount, RxBytes, and TxBytes. I think the author assumed that these are counts that only go up, but they are guages and eventually zero back out, so there are race condtions where not all of them are non-zero at the same time.
1 parent88b7c9e commitb1f59aa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎agent/agent_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func TestAgent_Stats_Magic(t *testing.T) {
190190
s,ok:=<-stats
191191
t.Logf("got stats: ok=%t, ConnectionCount=%d, RxBytes=%d, TxBytes=%d, SessionCountVSCode=%d, ConnectionMedianLatencyMS=%f",
192192
ok,s.ConnectionCount,s.RxBytes,s.TxBytes,s.SessionCountVscode,s.ConnectionMedianLatencyMs)
193-
returnok&&s.ConnectionCount>0&&s.RxBytes>0&&s.TxBytes>0&&
193+
returnok&&
194194
// Ensure that the connection didn't count as a "normal" SSH session.
195195
// This was a special one, so it should be labeled specially in the stats!
196196
s.SessionCountVscode==1&&
@@ -258,8 +258,7 @@ func TestAgent_Stats_Magic(t *testing.T) {
258258
s,ok:=<-stats
259259
t.Logf("got stats with conn open: ok=%t, ConnectionCount=%d, SessionCountJetBrains=%d",
260260
ok,s.ConnectionCount,s.SessionCountJetbrains)
261-
returnok&&s.ConnectionCount>0&&
262-
s.SessionCountJetbrains==1
261+
returnok&&s.SessionCountJetbrains==1
263262
},testutil.WaitLong,testutil.IntervalFast,
264263
"never saw stats with conn open",
265264
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp