diff --git a/pkg/sanity/sanity.go b/pkg/sanity/sanity.go index bfcf65f4..b919bcb3 100644 --- a/pkg/sanity/sanity.go +++ b/pkg/sanity/sanity.go @@ -123,6 +123,9 @@ func (sc *SanityContext) setup() { // dynamically (and differently!) in a BeforeEach, so only // reuse the connection if the address is still the same. if sc.Conn == nil || sc.connAddress != sc.Config.Address { + if sc.Conn != nil { + sc.Conn.Close() + } By("connecting to CSI driver") sc.Conn, err = utils.Connect(sc.Config.Address) Expect(err).NotTo(HaveOccurred())