Skip to content

Commit

Permalink
fix(server): session race test
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Feb 21, 2023
1 parent eafb45f commit be76262
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func TestSession(t *testing.T) {
defer s.Close()
err := s.RequestPty("xterm", 80, 40, nil)
is.NoErr(err)
in, err := s.StdinPipe()
is.NoErr(err)
go func() {
time.Sleep(1 * time.Second)
s.Signal(gossh.SIGTERM)
// FIXME: exit with code 0 instead of forcibly closing the session
s.Close()
<-time.After(time.Second)
// Send "q" to exit the config command
in.Write([]byte("q"))
}()
err = s.Run("test")
var ee *gossh.ExitMissingError
is.True(errors.As(err, &ee))
err = s.Shell()
is.NoErr(err)
})
}

Expand Down

0 comments on commit be76262

Please sign in to comment.