Skip to content

Commit e11ac70

Browse files
committed
test(agent/agentssh): fix macos signal flake during close
I haven't been able to verify this fix, but I'm hoping this'll do it. Fixes coder/internal#558
1 parent 109e73b commit e11ac70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

agent/agentssh/agentssh_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"strings"
1414
"sync"
1515
"testing"
16+
"time"
1617

1718
"github.com/prometheus/client_golang/prometheus"
1819
"github.com/spf13/afero"
@@ -200,7 +201,11 @@ func TestNewServer_CloseActiveConnections(t *testing.T) {
200201
}
201202
assert.NoError(t, err)
202203

204+
// Allow the session to settle (i.e. reach echo).
203205
pty.ExpectMatchContext(ctx, "started")
206+
// Sleep a bit to ensure the sleep has started.
207+
time.Sleep(testutil.IntervalMedium)
208+
204209
close(ch)
205210

206211
err = sess.Wait()

0 commit comments

Comments
 (0)