7
7
"testing"
8
8
"time"
9
9
10
- server "github.com/docker/infrakit/rpc"
11
10
rpc "github.com/docker/infrakit/rpc/instance"
11
+ "github.com/docker/infrakit/rpc/server"
12
12
"github.com/stretchr/testify/require"
13
13
)
14
14
@@ -31,17 +31,15 @@ func TestDirDiscovery(t *testing.T) {
31
31
32
32
name1 := "server1"
33
33
path1 := filepath .Join (dir , name1 )
34
- stop1 , errors1 , err1 := server .StartPluginAtPath (path1 , rpc .PluginServer (nil ))
35
- require .NoError (t , err1 )
36
- require .NotNil (t , stop1 )
37
- require .NotNil (t , errors1 )
34
+ server1 , err := server .StartPluginAtPath (path1 , rpc .PluginServer (nil ))
35
+ require .NoError (t , err )
36
+ require .NotNil (t , server1 )
38
37
39
38
name2 := "server2"
40
39
path2 := filepath .Join (dir , name2 )
41
- stop2 , errors2 , err2 := server .StartPluginAtPath (path2 , rpc .PluginServer (nil ))
42
- require .NoError (t , err2 )
43
- require .NotNil (t , stop2 )
44
- require .NotNil (t , errors2 )
40
+ server2 , err := server .StartPluginAtPath (path2 , rpc .PluginServer (nil ))
41
+ require .NoError (t , err )
42
+ require .NotNil (t , server2 )
45
43
46
44
discover , err := newDirPluginDiscovery (dir )
47
45
require .NoError (t , err )
@@ -55,7 +53,7 @@ func TestDirDiscovery(t *testing.T) {
55
53
require .NotNil (t , p )
56
54
57
55
// Now we stop the servers
58
- close ( stop1 )
56
+ server1 . Stop ( )
59
57
blockWhileFileExists (path1 )
60
58
61
59
p , err = discover .Find (name1 )
@@ -65,7 +63,7 @@ func TestDirDiscovery(t *testing.T) {
65
63
require .NoError (t , err )
66
64
require .NotNil (t , p )
67
65
68
- close ( stop2 )
66
+ server2 . Stop ( )
69
67
70
68
blockWhileFileExists (path2 )
71
69
0 commit comments