(t *testing.T)
| 532 | } |
| 533 | |
| 534 | func TestClientClosesCleanly(t *testing.T) { |
| 535 | in := &proxy.Config{ |
| 536 | Addr: "127.0.0.1", |
| 537 | Port: 24013, |
| 538 | Instances: []proxy.InstanceConnConfig{ |
| 539 | {Name: "proj:reg:inst"}, |
| 540 | }, |
| 541 | } |
| 542 | c, err := proxy.NewClient(context.Background(), &fakeDialer{}, testLogger, in, nil) |
| 543 | if err != nil { |
| 544 | t.Fatalf("proxy.NewClient error want = nil, got = %v", err) |
| 545 | } |
| 546 | go c.Serve(context.Background(), func() {}) |
| 547 | |
| 548 | conn := tryTCPDial(t, "127.0.0.1:24013") |
| 549 | _ = conn.Close() |
| 550 | |
| 551 | if err := c.Close(); err != nil { |
| 552 | t.Fatalf("c.Close() error = %v", err) |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | func TestClosesWithError(t *testing.T) { |
| 557 | in := &proxy.Config{ |
nothing calls this directly
no test coverage detected