Skip to content

Commit 59fd585

Browse files
committed
fix test
1 parent 34f07fc commit 59fd585

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

agent/agentssh/agentssh_internal_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"testing"
1111

1212
gliderssh "github.com/gliderlabs/ssh"
13+
"github.com/prometheus/client_golang/prometheus"
1314
"github.com/spf13/afero"
1415
"github.com/stretchr/testify/assert"
1516
"github.com/stretchr/testify/require"
@@ -36,7 +37,7 @@ func Test_sessionStart_orphan(t *testing.T) {
3637
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
3738
defer cancel()
3839
logger := slogtest.Make(t, nil)
39-
s, err := NewServer(ctx, logger, afero.NewMemMapFs(), 0, "")
40+
s, err := NewServer(ctx, logger, prometheus.NewRegistry(), afero.NewMemMapFs(), 0, "")
4041
require.NoError(t, err)
4142

4243
// Here we're going to call the handler directly with a faked SSH session
@@ -60,7 +61,7 @@ func Test_sessionStart_orphan(t *testing.T) {
6061
// we don't really care what the error is here. In the larger scenario,
6162
// the client has disconnected, so we can't return any error information
6263
// to them.
63-
m := metricsForSession("ssh")
64+
m := metricsForSession(s.metrics.sessions, "ssh")
6465
_ = s.startPTYSession(sess, m, cmd, ptyInfo, windowSize)
6566
}()
6667

0 commit comments

Comments
 (0)