test(agent/agentssh): fix macos signal flake during close (#17313)

Fixes coder/internal#558
This commit is contained in:
Mathias Fredriksson
2025-04-09 20:28:32 +03:00
committed by GitHub
parent 109e73bf97
commit 98c05b3568
+5
View File
@@ -13,6 +13,7 @@ import (
"strings"
"sync"
"testing"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/afero"
@@ -200,7 +201,11 @@ func TestNewServer_CloseActiveConnections(t *testing.T) {
}
assert.NoError(t, err)
// Allow the session to settle (i.e. reach echo).
pty.ExpectMatchContext(ctx, "started")
// Sleep a bit to ensure the sleep has started.
time.Sleep(testutil.IntervalMedium)
close(ch)
err = sess.Wait()