diff --git a/tools/package_lxd_test/container.go b/tools/package_lxd_test/container.go index 061f437e3ea53..bcba9ad5c5db7 100644 --- a/tools/package_lxd_test/container.go +++ b/tools/package_lxd_test/container.go @@ -260,9 +260,8 @@ func (c *Container) waitForNetwork() error { attempts := 0 for { - err := c.client.Exec(c.Name, "getent", "hosts", "influxdata.com") - if err != nil { - return err + if err := c.client.Exec(c.Name, "getent", "hosts", "influxdata.com"); err == nil { + return nil } // uses exponetnial backoff to try after 1, 2, 4, 8, and 16 seconds