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.

28 lines
553 B

  1. package abcicli_test
  2. import (
  3. "errors"
  4. "testing"
  5. "time"
  6. "github.com/tendermint/abci/client"
  7. )
  8. func TestSocketClientStopForErrorDeadlock(t *testing.T) {
  9. c := abcicli.NewSocketClient(":80", false)
  10. err := errors.New("foo-tendermint")
  11. // See Issue https://github.com/tendermint/abci/issues/114
  12. doneChan := make(chan bool)
  13. go func() {
  14. defer close(doneChan)
  15. c.StopForError(err)
  16. c.StopForError(err)
  17. }()
  18. select {
  19. case <-doneChan:
  20. case <-time.After(time.Second * 4):
  21. t.Fatalf("Test took too long, potential deadlock still exists")
  22. }
  23. }