diff --git a/test/integration.yaml b/test/integration.yaml index de096dc734d6a5..2e50ea020d355e 100644 --- a/test/integration.yaml +++ b/test/integration.yaml @@ -49,7 +49,7 @@ spec: serviceAccountName: integration-svc containers: - name: tests - image: eu.gcr.io/gitpod-core-dev/build/integration-tests:to-cgv2-itest.35 + image: eu.gcr.io/gitpod-core-dev/build/integration-tests:to-cgv2-itest.39 imagePullPolicy: Always #args: ["-username=sagor999"] #args: ["-enterprise=true"] diff --git a/test/tests/workspace/cgroup_v2_test.go b/test/tests/workspace/cgroup_v2_test.go index 976b81c9598713..8f36e059b90bc8 100644 --- a/test/tests/workspace/cgroup_v2_test.go +++ b/test/tests/workspace/cgroup_v2_test.go @@ -8,6 +8,8 @@ import ( "context" "fmt" "path/filepath" + "sort" + "strings" "testing" "time" @@ -17,12 +19,13 @@ import ( agent "github.com/gitpod-io/gitpod/test/pkg/agent/workspace/api" "github.com/gitpod-io/gitpod/test/pkg/integration" "github.com/gitpod-io/gitpod/test/tests/workspace/common" + "github.com/google/go-cmp/cmp" ) func TestCgroupV2(t *testing.T) { f := features.New("cgroup v2"). WithLabel("component", "workspace"). - Assess("it should create a new cgroup when cgroup v2 enable", func(_ context.Context, t *testing.T, cfg *envconf.Config) context.Context { + Assess("it should create a new cgroup when cgroup v2 is enabled", func(_ context.Context, t *testing.T, cfg *envconf.Config) context.Context { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) defer cancel() @@ -92,9 +95,20 @@ func TestCgroupV2(t *testing.T) { t.Fatalf("cgroup v2 controllers check failed: %s\n%s", respCheckControllers.Stdout, respCheckControllers.Stderr) } - expect := "cpuset cpu io memory hugetlb pids rdma" - if respCheckControllers.Stdout == expect { - t.Fatalf("cgroup v2 controllers check failed:\nexpect %s\nact%s", expect, respCheckControllers.Stdout) + expect := []string{ + "cpuset", + "cpu", + "io", + "memory", + "hugetlb", + "pids", + "rdma", + } + sort.Strings(expect) + act := strings.Split(strings.TrimSuffix(respCheckControllers.Stdout, "\n"), " ") + sort.Strings(act) + if diff := cmp.Diff(act, expect); len(diff) != 0 { + t.Errorf("cgroup v2 controllers mismatch (-want +got):\n%s", diff) } return ctx