test(agent/agentssh): close SSH servers in all tests (#7911)

Potentially solves the flake seen here:

https://github.com/coder/coder/actions/runs/5167029213/jobs/9307647816.
This commit is contained in:
Ammar Bandukwala
2023-06-07 18:43:38 -05:00
committed by GitHub
parent f6db95e71c
commit fcca639d38
2 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,7 @@ func Test_sessionStart_orphan(t *testing.T) {
logger := slogtest.Make(t, nil)
s, err := NewServer(ctx, logger, prometheus.NewRegistry(), afero.NewMemMapFs(), 0, "")
require.NoError(t, err)
defer s.Close()
// Here we're going to call the handler directly with a faked SSH session
// that just uses io.Pipes instead of a network socket. There is a large