(t *testing.T)
| 65 | } |
| 66 | |
| 67 | func (s) TestGracefulStop(t *testing.T) { |
| 68 | |
| 69 | lis, err := net.Listen("tcp", "localhost:0") |
| 70 | if err != nil { |
| 71 | t.Fatalf("failed to create listener: %v", err) |
| 72 | } |
| 73 | |
| 74 | server := NewServer() |
| 75 | go func() { |
| 76 | // make sure Serve() is called |
| 77 | time.Sleep(time.Millisecond * 500) |
| 78 | server.GracefulStop() |
| 79 | }() |
| 80 | |
| 81 | err = server.Serve(lis) |
| 82 | if err != nil { |
| 83 | t.Fatalf("Serve() returned non-nil error on GracefulStop: %v", err) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | func (s) TestGetServiceInfo(t *testing.T) { |
| 88 | testSd := ServiceDesc{ |
nothing calls this directly
no test coverage detected