Skip to content

Commit 408c119

Browse files
author
Noam Preil
committed
flight/test: panic if unable to init
1 parent 57b582e commit 408c119

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arrow/flight/basic_auth_flight_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,17 @@ func (*validator) IsValid(bearerToken string) (interface{}, error) {
7373
func TestErrorAuths(t *testing.T) {
7474
unary, stream := flight.CreateServerBearerTokenAuthInterceptors(&validator{})
7575
s := flight.NewFlightServer(grpc.UnaryInterceptor(unary), grpc.StreamInterceptor(stream))
76-
s.Init("localhost:0")
76+
if err := s.Init("localhost:0"); err != nil {
77+
panic(err)
78+
}
7779
f := &HeaderAuthTestFlight{}
7880
s.RegisterFlightService(f)
7981

80-
go s.Serve()
82+
go func () {
83+
if err := s.Serve(); err != nil {
84+
t.Fatal(err)
85+
}
86+
}()
8187
defer s.Shutdown()
8288

8389
client, err := flight.NewFlightClient(s.Addr().String(), nil, grpc.WithTransportCredentials(insecure.NewCredentials()))

0 commit comments

Comments
 (0)