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.

24 lines
294 B

  1. package common
  2. import (
  3. "testing"
  4. )
  5. func TestBaseServiceWait(t *testing.T) {
  6. type TestService struct {
  7. BaseService
  8. }
  9. ts := &TestService{}
  10. ts.BaseService = *NewBaseService(nil, "TestService", ts)
  11. ts.Start()
  12. go func() {
  13. ts.Stop()
  14. }()
  15. for i := 0; i < 10; i++ {
  16. ts.Wait()
  17. }
  18. }