rpc: exit from Start after Listener is running
If port is dynamically allocated, `(*Server).Addr` will contain 0 port. This commit executes listener before exiting from `Start()` and sets Addr to the actual address.
This commit is contained in:
parent
911be78cc7
commit
758a88a813
3 changed files with 20 additions and 6 deletions
|
@ -68,7 +68,7 @@ func initClearServerWithInMemoryChain(t *testing.T) (*core.Blockchain, *Server,
|
|||
require.NoError(t, err)
|
||||
rpcServer := New(chain, cfg.ApplicationConfiguration.RPC, server, logger)
|
||||
errCh := make(chan error, 2)
|
||||
go rpcServer.Start(errCh)
|
||||
rpcServer.Start(errCh)
|
||||
|
||||
handler := http.HandlerFunc(rpcServer.handleHTTPRequest)
|
||||
srv := httptest.NewServer(handler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue