Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fcb04be

Browse files
committed
add a sleep to avoid testing early
1 parent dbaeb0b commit fcb04be

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

agent/agentssh/agentssh_test.go

Lines changed: 3 additions & 0 deletions
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"
@@ -195,7 +196,9 @@ func TestNewServer_CloseActiveConnections(t *testing.T) {
195196
err = sess.Start("/bin/bash -c 'trap \"sleep 60\" SIGTERM; sleep 60'")
196197
assert.NoError(t, err)
197198

199+
time.Sleep(100 * time.Millisecond) // Give the session time to start.
198200
close(ch)
201+
199202
err = sess.Wait()
200203
assert.Error(t, err)
201204
}(waitConns[i])

0 commit comments

Comments
 (0)