Skip to content

Commit

Permalink
fix(fleet): More flaky mitigations again (#32495)
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptisteFoy authored Dec 24, 2024
1 parent 00ecffe commit f93202d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
12 changes: 9 additions & 3 deletions pkg/fleet/installer/packages/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ func (a *apmInjectorInstaller) verifyDockerRuntime(ctx context.Context) (err err
return nil
}

for i := 0; i < 3; i++ {
currentRuntime := ""
for i := 0; i < 5; i++ {
if i > 0 {
time.Sleep(time.Second)
}
Expand All @@ -157,17 +158,22 @@ func (a *apmInjectorInstaller) verifyDockerRuntime(ctx context.Context) (err err
cmd.Stdout = &outb
err = cmd.Run()
if err != nil {
if i < 2 {
if i < 5 {
log.Debug("failed to verify docker runtime, retrying: ", err)
} else {
log.Warn("failed to verify docker runtime: ", err)
}
}
if strings.TrimSpace(outb.String()) == "dd-shim" {
span.SetTag("retries", i)
span.SetTag("docker_runtime", "dd-shim")
return nil
}
currentRuntime = strings.TrimSpace(outb.String())
}
err = fmt.Errorf("docker default runtime has not been set to injector docker runtime")
span.SetTag("retries", 5)
span.SetTag("docker_runtime", currentRuntime)
err = fmt.Errorf("docker default runtime has not been set to injector docker runtime (is \"%s\")", currentRuntime)
return err
}

Expand Down
9 changes: 8 additions & 1 deletion test/new-e2e/tests/installer/host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ func (h *Host) setSystemdVersion() {

// InstallDocker installs Docker on the host if it is not already installed.
func (h *Host) InstallDocker() {
defer func() { h.remote.MustExecute("sudo systemctl start docker") }()
defer func() {
_, err := h.remote.Execute("sudo systemctl reset-failed docker")
if err != nil {
h.t.Logf("warn: failed to reset-failed for docker.d: %v", err)
}
_, err = h.remote.Execute("sudo systemctl start docker")
require.NoErrorf(h.t, err, "failed to start Docker, logs: %s", h.remote.MustExecute("sudo journalctl -xeu docker"))
}()
if _, err := h.remote.Execute("command -v docker"); err == nil {
return
}
Expand Down
8 changes: 1 addition & 7 deletions test/new-e2e/tests/installer/unix/all_packages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/DataDog/test-infra-definitions/scenarios/aws/ec2"
"github.com/stretchr/testify/require"

"github.com/DataDog/datadog-agent/pkg/util/testutil/flake"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
Expand All @@ -40,7 +39,7 @@ var (
e2eos.AmazonLinux2,
e2eos.Debian12,
e2eos.RedHat9,
e2eos.FedoraDefault,
// e2eos.FedoraDefault, // Skipped instead of marked as flaky to avoid useless logs
e2eos.CentOS7,
e2eos.Suse15,
}
Expand Down Expand Up @@ -108,11 +107,6 @@ func TestPackages(t *testing.T) {
suite := test.t(flavor, flavor.Architecture, method)
t.Run(suite.Name(), func(t *testing.T) {
t.Parallel()
// FIXME: Fedora currently has DNS issues
if flavor.Flavor == e2eos.Fedora {
flake.Mark(t)
}

opts := []awshost.ProvisionerOption{
awshost.WithEC2InstanceOptions(ec2.WithOSArch(flavor, flavor.Architecture)),
awshost.WithoutAgent(),
Expand Down

0 comments on commit f93202d

Please sign in to comment.