We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent9e228f6 commitb03cc29Copy full SHA for b03cc29
coderd/insights_test.go
@@ -160,6 +160,17 @@ func TestUserLatencyInsights(t *testing.T) {
160
require.NoError(t,err)
161
defersshConn.Close()
162
163
+sess,err:=sshConn.NewSession()
164
+require.NoError(t,err)
165
+defersess.Close()
166
+
167
+r,w:=io.Pipe()
168
+deferr.Close()
169
+deferw.Close()
170
+sess.Stdin=r
171
+err=sess.Start("cat")
172
173
174
varuserLatencies codersdk.UserLatencyInsightsResponse
175
require.Eventuallyf(t,func()bool {
176
userLatencies,err=client.UserLatencyInsights(ctx, codersdk.UserLatencyInsightsRequest{
@@ -174,6 +185,7 @@ func TestUserLatencyInsights(t *testing.T) {
185
},testutil.WaitShort,testutil.IntervalFast,"user latency is missing")
186
187
// We got our latency data, close the connection.
188
+_=sess.Close()
177
189
_=sshConn.Close()
178
190
179
191
require.Len(t,userLatencies.Report.Users,1,"want only 1 user")