Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: TestLockOSThreadExit failing on arm64 builder #29366
The failures started at d0f8a75 (runtime: don't clear lockedExt on locked M when G exits), which slightly changed the test.
It looks like on linux/arm64 for whatever reason unshare(CLONE_FS) is either unsupported, or just not allowed to be executed by the user running the tests.
If I were to take a wild guess, it might have to do with the way the arm64 builders are containerized. If there's a security issue with enabling unshare, then I'm happy to just disable the test on arm64. It's an easy fix.
In that case, it's somewhat unclear to me what the correct fix is.
Thinking about this more, I'm not sure I like disabling the test for arm64, since it's not a property of linux/arm64 that the test fails. If the test is running in any environment where certain syscalls are unavailable then there's not much one can do.
Ideally I'd like to just have the test fail gracefully if it doesn't have permissions to execute a certain syscall. However, this is more dangerous and confusing since if all the builders stop letting the tests call unshare, then we wouldn't notice, and the test could be passing even if the functionality is broken.
So, I decided to put up a change to just disable the test. Let me know if this seems reasonable. I poked around and it seems like some of the other tests are turned off for different platforms for builder reasons, so I figured it was OK.
I think it would be good that we skip the test on platforms that doesn't support, maybe by testing kernel configurations or trying a syscall. So users won't see this kind of failures if they have such configurations.
For the concern of actually testing the functionality, I guess we could require the tests not to be skipped on certain builders? I.e., something like
…agation if one can't unshare This change splits a testprog out of TestLockOSThreadExit and makes it its own test. Then, this change makes the testprog exit prematurely with a special message if unshare fails with EPERM because not all of the builders allow the user to call the unshare syscall. Also, do some minor cleanup on the TestLockOSThread* tests. Fixes #29366. Change-Id: Id8a9f6c4b16e26af92ed2916b90b0249ba226dbe Reviewed-on: https://go-review.googlesource.com/c/155437 Run-TryBot: Michael Knyszek <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Brad Fitzpatrick <email@example.com> (cherry picked from commit 429bae7) Reviewed-on: https://go-review.googlesource.com/c/go/+/167707 Run-TryBot: Andrew Bonventre <firstname.lastname@example.org> Reviewed-by: Michael Knyszek <email@example.com>