mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-06-10 04:12:07 +03:00
Revert "possibly fix the test timeout in HostNameCollision" (didn't work)
This reverts commit 664dbb0976f8f10ea7a673950a879591c2e7c320.
This commit is contained in:
parent
664dbb0976
commit
a8abf7091a
12
host_test.go
12
host_test.go
@ -108,11 +108,9 @@ func TestHostNameCollision(t *testing.T) {
|
|||||||
s, host := getHost(t, nil)
|
s, host := getHost(t, nil)
|
||||||
defer s.Close()
|
defer s.Close()
|
||||||
|
|
||||||
newUsers1 := make(chan *message.User)
|
newUsers := make(chan *message.User)
|
||||||
newUsers2 := make(chan *message.User)
|
|
||||||
host.OnUserJoined = func(u *message.User) {
|
host.OnUserJoined = func(u *message.User) {
|
||||||
newUsers1 <- u
|
newUsers <- u
|
||||||
newUsers2 <- u
|
|
||||||
}
|
}
|
||||||
go host.Serve()
|
go host.Serve()
|
||||||
|
|
||||||
@ -121,7 +119,6 @@ func TestHostNameCollision(t *testing.T) {
|
|||||||
// First client
|
// First client
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
return sshd.ConnectShell(s.Addr().String(), "foo", func(r io.Reader, w io.WriteCloser) error {
|
return sshd.ConnectShell(s.Addr().String(), "foo", func(r io.Reader, w io.WriteCloser) error {
|
||||||
<-newUsers1
|
|
||||||
scanner := bufio.NewScanner(r)
|
scanner := bufio.NewScanner(r)
|
||||||
|
|
||||||
// Consume the initial buffer
|
// Consume the initial buffer
|
||||||
@ -133,7 +130,7 @@ func TestHostNameCollision(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wait for the second client
|
// wait for the second client
|
||||||
<-newUsers1
|
<-newUsers
|
||||||
|
|
||||||
scanner.Scan()
|
scanner.Scan()
|
||||||
actual = scanner.Text()
|
actual = scanner.Text()
|
||||||
@ -155,9 +152,8 @@ func TestHostNameCollision(t *testing.T) {
|
|||||||
// Second client
|
// Second client
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
// wait for the first client
|
// wait for the first client
|
||||||
<-newUsers2
|
<-newUsers
|
||||||
return sshd.ConnectShell(s.Addr().String(), "foo", func(r io.Reader, w io.WriteCloser) error {
|
return sshd.ConnectShell(s.Addr().String(), "foo", func(r io.Reader, w io.WriteCloser) error {
|
||||||
<-newUsers2
|
|
||||||
scanner := bufio.NewScanner(r)
|
scanner := bufio.NewScanner(r)
|
||||||
// Consume the initial buffer
|
// Consume the initial buffer
|
||||||
scanner.Scan()
|
scanner.Scan()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user