From 39c441969c1f347e17ce5f292b3e8cf4c8c887cb Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 3 Aug 2026 16:16:39 -0700 Subject: [PATCH] ci: skip running TestParallelConnections locally I nuked my GNOME session twice today by running go test ./... here. Apparently what happens is too many user's connections result in this: dbus-broker-launch: ERROR sockopt_get_peerpidfd: Too many open files peer_new_with_fd @ ../src/bus/peer.c +290 listener_dispatch @ ../src/bus/listener.c +54 dbus-broker-launch: Caught SIGCHLD of broker. and then everything dies. Let's not run this test unless CGROUPS_ALLOW_UNSAFE_TESTS is set (and set this in GHA CI). Signed-off-by: Kir Kolyshkin --- .github/workflows/test.yml | 4 ++-- systemd/dbus_test.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1227a15..80ea6aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/setup-go@v7 with: go-version: ${{ matrix.go-version }} - - run: go test -timeout 3m ${{ matrix.race }} -v ./... + - run: CGROUPS_ALLOW_UNSAFE_TESTS=true go test -timeout 3m ${{ matrix.race }} -v ./... cgroup-v1: name: "cgroup v1 (AlmaLinux 8)" @@ -57,7 +57,7 @@ jobs: lima sudo dnf install -y golang - name: "Run unit tests" - run: LIMA_WORKDIR=/tmp/cgroups lima sudo GOTOOLCHAIN=auto go test -v ./... + run: LIMA_WORKDIR=/tmp/cgroups lima sudo GOTOOLCHAIN=auto CGROUPS_ALLOW_UNSAFE_TESTS=true go test -v ./... all-done: needs: diff --git a/systemd/dbus_test.go b/systemd/dbus_test.go index 50bde38..4ed5dd2 100644 --- a/systemd/dbus_test.go +++ b/systemd/dbus_test.go @@ -11,6 +11,10 @@ func TestParallelConnection(t *testing.T) { if !IsRunningSystemd() { t.Skip("Test requires systemd.") } + if _, ok := os.LookupEnv("CGROUPS_ALLOW_UNSAFE_TESTS"); !ok { + t.Skip("skipping unsafe test (can kill your desktop session); " + + "set CGROUPS_ALLOW_UNSAFE_TESTS=true to enable") + } var dms []*dbusConnManager for range 600 { dms = append(dms, newDbusConnManager(os.Geteuid() != 0))