You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. package tests
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/fortytw2/leaktest"
  6. "github.com/stretchr/testify/assert"
  7. abciclientent "github.com/tendermint/tendermint/abci/client"
  8. "github.com/tendermint/tendermint/abci/example/kvstore"
  9. abciserver "github.com/tendermint/tendermint/abci/server"
  10. "github.com/tendermint/tendermint/libs/log"
  11. )
  12. func TestClientServerNoAddrPrefix(t *testing.T) {
  13. t.Cleanup(leaktest.Check(t))
  14. ctx, cancel := context.WithCancel(context.Background())
  15. defer cancel()
  16. const (
  17. addr = "localhost:26658"
  18. transport = "socket"
  19. )
  20. app := kvstore.NewApplication()
  21. logger := log.NewTestingLogger(t)
  22. server, err := abciserver.NewServer(logger, addr, transport, app)
  23. assert.NoError(t, err, "expected no error on NewServer")
  24. err = server.Start(ctx)
  25. assert.NoError(t, err, "expected no error on server.Start")
  26. t.Cleanup(server.Wait)
  27. client, err := abciclientent.NewClient(logger, addr, transport, true)
  28. assert.NoError(t, err, "expected no error on NewClient")
  29. err = client.Start(ctx)
  30. assert.NoError(t, err, "expected no error on client.Start")
  31. t.Cleanup(client.Wait)
  32. }