Skip to content

ci: skip running TestParallelConnections locally - #71

Open
kolyshkin wants to merge 1 commit into
opencontainers:mainfrom
kolyshkin:unsafe-tests
Open

ci: skip running TestParallelConnections locally#71
kolyshkin wants to merge 1 commit into
opencontainers:mainfrom
kolyshkin:unsafe-tests

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

I nuked my GNOME session twice today by running go test ./... on this repo.

Apparently what happens is too many user's connections created by
TestParallelConnection 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.

Apparently dbus-broker sees EMFILE and dies, taking
the whole desktop session down with it. 💣

Let's not run this test unless CGROUPS_ALLOW_UNSAFE_TESTS
is set (and set this in GHA CI).

@kolyshkin
kolyshkin requested a review from a team as a code owner August 3, 2026 23:24
@kolyshkin kolyshkin added this to the 0.0.9 milestone Aug 3, 2026
Comment thread systemd/dbus_test.go
if !IsRunningSystemd() {
t.Skip("Test requires systemd.")
}
if _, ok := os.LookupEnv("CGROUPS_ALLOW_UNSAFE_TESTS"); !ok {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: strconv.ParseBool should be used to allow negative boolean values

Alternatively you can define a -test.*=<BOOL> flag

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Can do strconv.ParseBool here, yet I was just mimicking what we have in runc (variable presense/absense is a flag, not its value).

  2. A CLI flag is more cumbersome to use in complex scenarios, as you have to specify it every time you call go test or the test binary. With an environment variable, you only have to set it once for every test environment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, strconv.ParseBool fails when the value is unset (os.Getenv() returns an empty string, so the proper handling is becoming a burden, whereas the current solution merely relies on env var being present/absent.

I'd rather keep this as is (simple), unless there's a compelling reason not to.

Comment thread systemd/dbus_test.go Outdated
t.Skip("Test requires systemd.")
}
if _, ok := os.LookupEnv("CGROUPS_ALLOW_UNSAFE_TESTS"); !ok {
t.Skip("unsafe test (requires CGROUPS_ALLOW_UNSAFE_TESTS env var set)")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment line to explain how it is unsafe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

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 <kolyshkin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants