(m *testing.M)
| 74 | } |
| 75 | |
| 76 | func TestMain(m *testing.M) { |
| 77 | flag.Parse() |
| 78 | |
| 79 | ctx, cancel := context.WithCancel(context.Background()) |
| 80 | defer cancel() |
| 81 | errCh := runServers(ctx) |
| 82 | |
| 83 | ch := make(chan int, 1) |
| 84 | go func() { |
| 85 | if err := waitForGateway(ctx, 8088); err != nil { |
| 86 | grpclog.Errorf("waitForGateway(ctx, 8088) failed with %v; want success", err) |
| 87 | } |
| 88 | ch <- m.Run() |
| 89 | }() |
| 90 | |
| 91 | select { |
| 92 | case err := <-errCh: |
| 93 | fmt.Fprintln(os.Stderr, err) |
| 94 | os.Exit(1) |
| 95 | case status := <-ch: |
| 96 | cancel() |
| 97 | os.Exit(status) |
| 98 | } |
| 99 | } |
nothing calls this directly
no test coverage detected