@@ -10,6 +10,7 @@ import (
10
10
"testing"
11
11
12
12
gliderssh "github.com/gliderlabs/ssh"
13
+ "github.com/prometheus/client_golang/prometheus"
13
14
"github.com/spf13/afero"
14
15
"github.com/stretchr/testify/assert"
15
16
"github.com/stretchr/testify/require"
@@ -36,7 +37,7 @@ func Test_sessionStart_orphan(t *testing.T) {
36
37
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitMedium )
37
38
defer cancel ()
38
39
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 , "" )
40
41
require .NoError (t , err )
41
42
42
43
// 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) {
60
61
// we don't really care what the error is here. In the larger scenario,
61
62
// the client has disconnected, so we can't return any error information
62
63
// to them.
63
- m := metricsForSession ("ssh" )
64
+ m := metricsForSession (s . metrics . sessions , "ssh" )
64
65
_ = s .startPTYSession (sess , m , cmd , ptyInfo , windowSize )
65
66
}()
66
67
0 commit comments