Skip to content

Commit

Permalink
Only panic if err is different than the regular stop error
Browse files Browse the repository at this point in the history
  • Loading branch information
christeredvartsen committed Jan 6, 2025
1 parent 39f95dc commit 2e2583e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/reconcilers/google/gar/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package google_gar_reconciler_test
import (
"context"
"encoding/json"
"errors"
"fmt"
"maps"
"net"
Expand Down Expand Up @@ -124,13 +125,13 @@ func (m *mocks) start(t *testing.T, ctx context.Context) (*artifactregistry.Clie
srv := grpc.NewServer()
artifactregistrypb.RegisterArtifactRegistryServer(srv, m.artifactRegistry)
go func() {
if err := srv.Serve(l); err != nil {
if err := srv.Serve(l); err != nil && !errors.Is(err, grpc.ErrServerStopped) {
panic(err)
}
}()
t.Cleanup(func() {
m.artifactRegistry.assert(t)
srv.Stop()
srv.GracefulStop()
})

artifactRegistryClient, err = artifactregistry.NewClient(ctx,
Expand Down

0 comments on commit 2e2583e

Please sign in to comment.