77 "testing"
88 "time"
99
10- server "github.com/docker/infrakit/rpc"
1110 rpc "github.com/docker/infrakit/rpc/instance"
11+ "github.com/docker/infrakit/rpc/server"
1212 "github.com/stretchr/testify/require"
1313)
1414
@@ -31,17 +31,15 @@ func TestDirDiscovery(t *testing.T) {
3131
3232 name1 := "server1"
3333 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 )
3837
3938 name2 := "server2"
4039 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 )
4543
4644 discover , err := newDirPluginDiscovery (dir )
4745 require .NoError (t , err )
@@ -55,7 +53,7 @@ func TestDirDiscovery(t *testing.T) {
5553 require .NotNil (t , p )
5654
5755 // Now we stop the servers
58- close ( stop1 )
56+ server1 . Stop ( )
5957 blockWhileFileExists (path1 )
6058
6159 p , err = discover .Find (name1 )
@@ -65,7 +63,7 @@ func TestDirDiscovery(t *testing.T) {
6563 require .NoError (t , err )
6664 require .NotNil (t , p )
6765
68- close ( stop2 )
66+ server2 . Stop ( )
6967
7068 blockWhileFileExists (path2 )
7169
0 commit comments