Skip to content

Commit

Permalink
skip testing memory swappiness for cgroupv2
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and mythri-garaga committed Apr 12, 2023
1 parent 6a3412a commit a692063
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion agent/engine/engine_unix_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import (
"github.com/aws/amazon-ecs-agent/agent/utils"
"github.com/aws/amazon-ecs-agent/agent/utils/ttime"
"github.com/aws/aws-sdk-go/aws"

"github.com/containerd/cgroups"
sdkClient "github.com/docker/docker/client"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -891,7 +893,10 @@ func TestSwapConfigurationTask(t *testing.T) {
cid := containerMap[testTask.Containers[0].Name].DockerID
state, _ := client.ContainerInspect(ctx, cid)
require.EqualValues(t, 314572800, state.HostConfig.MemorySwap)
require.EqualValues(t, 90, *state.HostConfig.MemorySwappiness)
// skip testing memory swappiness for cgroupv2, since this control has been removed in cgroupv2
if cgroups.Mode() != cgroups.Unified {
require.EqualValues(t, 90, *state.HostConfig.MemorySwappiness)
}

// Kill the existing container now
taskUpdate := createTestTask(testArn)
Expand Down

0 comments on commit a692063

Please sign in to comment.