- Notifications
You must be signed in to change notification settings - Fork921
fix: use TSMP for pings and checking reachability#11306
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -174,10 +174,10 @@ func TestAgent_Stats_Magic(t *testing.T) { | ||
require.NoError(t, err) | ||
err = session.Shell() | ||
require.NoError(t, err) | ||
require.Eventuallyf(t, func() bool { | ||
s, ok := <-stats | ||
t.Logf("got stats: ok=%t, ConnectionCount=%d, RxBytes=%d, TxBytes=%d, SessionCountVSCode=%d, ConnectionMedianLatencyMS=%f", | ||
ok, s.ConnectionCount, s.RxBytes, s.TxBytes, s.SessionCountVSCode, s.ConnectionMedianLatencyMS) | ||
return ok && s.ConnectionCount > 0 && s.RxBytes > 0 && s.TxBytes > 0 && | ||
// Ensure that the connection didn't count as a "normal" SSH session. | ||
// This was a special one, so it should be labeled specially in the stats! | ||
@@ -186,7 +186,7 @@ func TestAgent_Stats_Magic(t *testing.T) { | ||
// If it isn't, it's set to -1. | ||
s.ConnectionMedianLatencyMS >= 0 | ||
}, testutil.WaitLong, testutil.IntervalFast, | ||
"never saw stats", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This gives misleading information since the pointer is passed on the initial call to | ||
) | ||
// The shell will automatically exit if there is no stdin! | ||
_ = stdin.Close() | ||
@@ -240,14 +240,14 @@ func TestAgent_Stats_Magic(t *testing.T) { | ||
_ = tunneledConn.Close() | ||
}) | ||
require.Eventuallyf(t, func() bool { | ||
s, ok := <-stats | ||
t.Logf("got stats with conn open: ok=%t, ConnectionCount=%d, SessionCountJetBrains=%d", | ||
ok, s.ConnectionCount, s.SessionCountJetBrains) | ||
return ok && s.ConnectionCount > 0 && | ||
s.SessionCountJetBrains == 1 | ||
}, testutil.WaitLong, testutil.IntervalFast, | ||
"never saw stats with conn open", | ||
) | ||
// Kill the server and connection after checking for the echo. | ||
@@ -256,12 +256,13 @@ func TestAgent_Stats_Magic(t *testing.T) { | ||
_ = tunneledConn.Close() | ||
require.Eventuallyf(t, func() bool { | ||
s, ok := <-stats | ||
t.Logf("got stats after disconnect %t, %d", | ||
ok, s.SessionCountJetBrains) | ||
return ok && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. TSMP ping counts as a "connection" in the agent stats so it never goes to zero. I'm not sure why we were testing it going to zero in the first place@code-asher There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think we wanted to make sure | ||
s.SessionCountJetBrains == 0 | ||
}, testutil.WaitLong, testutil.IntervalFast, | ||
"never saw stats after conn closes", | ||
) | ||
}) | ||
} | ||