func (s *pingerSuite) checkConnectionDies(c *gc.C, conn api.Connection) { attempt := utils.AttemptStrategy{ Total: coretesting.LongWait, Delay: coretesting.ShortWait, } for a := attempt.Start(); a.Next(); { err := conn.Ping() if err != nil { c.Assert(err, gc.ErrorMatches, "connection is shut down") return } } c.Fatal("connection didn't get shut down") }