mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 13:26:23 +00:00
test: stop abci server started in addr test (#9093)
This test would fail if run with "go test -count=2" because it uses a fixed address and was not closing the server, so the subsequent run could not bind to the address. While closing the server is correct, it would probably be better if the API was able to report the bound address so that we could pass "localhost:0" for an anonymous port. But I am currently focusing on test cleanup, not ready to change any existing APIs.
This commit is contained in:
@@ -19,9 +19,12 @@ func TestClientServerNoAddrPrefix(t *testing.T) {
|
||||
assert.NoError(t, err, "expected no error on NewServer")
|
||||
err = server.Start()
|
||||
assert.NoError(t, err, "expected no error on server.Start")
|
||||
defer func() { _ = server.Stop() }()
|
||||
|
||||
client, err := abciclient.NewClient(addr, transport, true)
|
||||
assert.NoError(t, err, "expected no error on NewClient")
|
||||
err = client.Start()
|
||||
assert.NoError(t, err, "expected no error on client.Start")
|
||||
|
||||
_ = client.Stop()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user