Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: logdog/client/butler/streamserver/namedPipe_windows_test.go

Issue 2866473002: Revert "Switch from "winio" to "npipe"." (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package streamserver 5 package streamserver
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "os" 9 "os"
10 "strings" 10 "strings"
11 "testing" 11 "testing"
12 12
13 "github.com/luci/luci-go/logdog/client/butlerlib/streamclient" 13 "github.com/luci/luci-go/logdog/client/butlerlib/streamclient"
14 14
15 "golang.org/x/net/context" 15 "golang.org/x/net/context"
16 16
17 . "github.com/luci/luci-go/common/testing/assertions" 17 . "github.com/luci/luci-go/common/testing/assertions"
18 . "github.com/smartystreets/goconvey/convey" 18 . "github.com/smartystreets/goconvey/convey"
19 ) 19 )
20 20
21 func TestWindowsNamedPipeServer(t *testing.T) { 21 func TestWindowsNamedPipeServer(t *testing.T) {
22 t.Parallel() 22 t.Parallel()
23 23
24 pid := os.Getpid() 24 pid := os.Getpid()
25 25
26 » // TODO(dnj): Re-enable after switching back to "winio" pending bug. 26 » Convey(`A named pipe server`, t, func() {
27 » // See: crbug.com/702105
28 » SkipConvey(`A named pipe server`, t, func() {
29 ctx := context.Background() 27 ctx := context.Background()
30 28
31 Convey(`Will refuse to create if there is an empty path.`, func( ) { 29 Convey(`Will refuse to create if there is an empty path.`, func( ) {
32 _, err := NewNamedPipeServer(ctx, "") 30 _, err := NewNamedPipeServer(ctx, "")
33 So(err, ShouldErrLike, "cannot have empty name") 31 So(err, ShouldErrLike, "cannot have empty name")
34 }) 32 })
35 33
36 Convey(`Will refuse to create if longer than maximum length.`, f unc() { 34 Convey(`Will refuse to create if longer than maximum length.`, f unc() {
37 _, err := NewNamedPipeServer(ctx, strings.Repeat("A", ma xWindowsNamedPipeLength+1)) 35 _, err := NewNamedPipeServer(ctx, strings.Repeat("A", ma xWindowsNamedPipeLength+1))
38 So(err, ShouldErrLike, "name exceeds maximum length") 36 So(err, ShouldErrLike, "name exceeds maximum length")
39 }) 37 })
40 38
41 Convey(`When created and listening.`, func() { 39 Convey(`When created and listening.`, func() {
42 svr, err := NewNamedPipeServer(ctx, fmt.Sprintf("ButlerN amedPipeTest_%d", pid)) 40 svr, err := NewNamedPipeServer(ctx, fmt.Sprintf("ButlerN amedPipeTest_%d", pid))
43 So(err, ShouldBeNil) 41 So(err, ShouldBeNil)
44 42
45 So(svr.Listen(), ShouldBeNil) 43 So(svr.Listen(), ShouldBeNil)
46 defer svr.Close() 44 defer svr.Close()
47 45
48 client, err := streamclient.New(svr.Address()) 46 client, err := streamclient.New(svr.Address())
49 So(err, ShouldBeNil) 47 So(err, ShouldBeNil)
50 48
51 testClientServer(t, svr, client) 49 testClientServer(t, svr, client)
52 }) 50 })
53 }) 51 })
54 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698