Skip to content

Commit

Permalink
Merge branch 'main' into api-gateway-stricter-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Stucki authored Feb 17, 2023
2 parents 70084e6 + ee99d5c commit 250ee78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agent/xds/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ type TestEnvoy struct {
EnvoyVersion string

deltaStream *TestADSDeltaStream // Incremental v3

closed bool
}

// NewTestEnvoy creates a TestEnvoy instance.
Expand Down Expand Up @@ -225,9 +227,9 @@ func (e *TestEnvoy) Close() error {
defer e.mu.Unlock()

// unblock the recv chans to simulate recv errors when client disconnects
if e.deltaStream != nil && e.deltaStream.recvCh != nil {
if !e.closed && e.deltaStream.recvCh != nil {
close(e.deltaStream.recvCh)
e.deltaStream = nil
e.closed = true
}
if e.cancel != nil {
e.cancel()
Expand Down

0 comments on commit 250ee78

Please sign in to comment.