Skip to content

Test flaking/failing due to CI runner switch to ubuntu26 and sudo-rs #14915

Open

Description

@brandond

Tests are now flaking due to environment variables not being passed by sudo on ubuntu26 runners.

See for example https://github.com/k3s-io/k3s/actions/runs/40607789739/job/122580661557?pr=14904#step:6:254

local storage when a new local storage is created [It] has proper folder permissions
/home/runner/work/k3s/k3s/tests/integration/localstorage/localstorage_int_test.go:61

  [FAILED] Expected
      <string>: warning: GOCOVERDIR not set, no coverage data emitted\n644\n
  to equal
      <string>: 644\n

Further up the run we see:

  chmod +x ./dist/artifacts/k3s
  mkdir -p $GOCOVERDIR
  cd tests/integration/localstorage
  sudo -E env "PATH=$PATH" go test -timeout=45m ./... -run Integration -ginkgo.v -test.v
  shell: /usr/bin/bash -e {0}
  env:
    GOCOVERDIR: /tmp/k3scov
    ImageOS: ubuntu26
    LATEST_RELEASE_REF: refs/heads/release-1.37
    GOTOOLCHAIN: local
    GO_CACHE: /home/runner/.cache/go-build
    GO_MODCACHE: /home/runner/go/pkg/mod
    GO_VERSION: 1.26.8
    ARCH_OPT: x64-ubuntu26
sudo: preserving the entire environment is not supported, '-E' is ignored

This differs from other passing runs, which have:

  chmod +x ./dist/artifacts/k3s
  mkdir -p $GOCOVERDIR
  cd tests/integration/localstorage
  sudo -E env "PATH=$PATH" go test -timeout=45m ./... -run Integration -ginkgo.v -test.v
  shell: /usr/bin/bash -e {0}
  env:
    GOCOVERDIR: /tmp/k3scov
    ImageOS: ubuntu24
    LATEST_RELEASE_REF: refs/heads/release-1.37
    GOTOOLCHAIN: local
    GO_CACHE: /home/runner/.cache/go-build
    GO_MODCACHE: /home/runner/go/pkg/mod
    GO_VERSION: 1.26.8
    ARCH_OPT: x64-ubuntu24

Due to ubuntu switching to sudo-rs, which intentionally does no support -E, all the env vars are dropped from the run. Ref:

Activity

  1. brandond commented on Oct 28, 2026

    @brandond
    MemberAuthor

    We might consider switching back to runs-on: ubuntu-24.04 or perhaps switching to a different runner image that does not use garbage sudo-rs.

  2. changed the title [-]Test flaking/failing due to CI runner switch to ubuntu26[/-] [+]Test flaking/failing due to CI runner switch to ubuntu26 and sudo-rs[/+] on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions