Commit e8176894 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 81efe5bd
...@@ -26,7 +26,7 @@ import ( ...@@ -26,7 +26,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"golang.org/x/sync/errgroup" "../../../xcommon/xsync"
"lab.nexedi.com/kirr/go123/exc" "lab.nexedi.com/kirr/go123/exc"
) )
...@@ -110,24 +110,21 @@ func TestPipeNet(t *testing.T) { ...@@ -110,24 +110,21 @@ func TestPipeNet(t *testing.T) {
l1 := xlisten(, "") l1 := xlisten(, "")
assertEq(t, l1.Addr(), addr("α:0")) assertEq(t, l1.Addr(), addr("α:0"))
// XXX -> use workGroup (in connection_test.go) wg := &xsync.WorkGroup{}
wg := &errgroup.Group{} wg.Gox(func() {
wg.Go(func() error { c1s := xaccept(l1)
return exc.Runx(func() { assertEq(t, c1s.LocalAddr(), addr("α:1"))
c1s := xaccept(l1) assertEq(t, c1s.RemoteAddr(), addr("β:0"))
assertEq(t, c1s.LocalAddr(), addr("α:1"))
assertEq(t, c1s.RemoteAddr(), addr("β:0"))
assertEq(t, xread(c1s), "ping") assertEq(t, xread(c1s), "ping")
xwrite(c1s, "pong") xwrite(c1s, "pong")
c2s := xaccept(l1) c2s := xaccept(l1)
assertEq(t, c2s.LocalAddr(), addr("α:2")) assertEq(t, c2s.LocalAddr(), addr("α:2"))
assertEq(t, c2s.RemoteAddr(), addr("β:1")) assertEq(t, c2s.RemoteAddr(), addr("β:1"))
assertEq(t, xread(c2s), "hello") assertEq(t, xread(c2s), "hello")
xwrite(c2s, "world") xwrite(c2s, "world")
})
}) })
c1c := xdial(, "α:0") c1c := xdial(, "α:0")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment