]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.21] syscall: copy rlimit.go's build constraint to rlimit_test.go
authorDmitri Shuralyov <dmitshur@golang.org>
Thu, 2 Nov 2023 18:36:30 +0000 (14:36 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 7 Nov 2023 20:32:49 +0000 (20:32 +0000)
commit1e91861f6709b96d1e1ea5b9f5fcb953d6c56416
treee63676a3690d54dfd5daae9d36a558c281f24a49
parented817f1c4055a559a94afffecbb91c78e4f39942
[release-branch.go1.21] syscall: copy rlimit.go's build constraint to rlimit_test.go

Tests in rlimit_test.go exist to test the behavior of automatically
bumping RLIMIT_NOFILE on Unix implemented in rlimit.go (issue #46279),
with darwin-specific behavior split out into rlimit_darwin.go and
the rest left empty in rlimit_stub.go.

Since the behavior happens only on Unix, it doesn't make sense to test
it on other platforms. Copy rlimit.go's 'unix' build constraint to
rlimit_test.go to accomplish that.

Leave out the simplification of the build constraint in rlimit_stub.go
so that this CL remains a test-only fix.

In particular, this fixes a problem where TestOpenFileLimit was
failing in some environments when testing the wasip1/wasm port.
The RLIMIT_NOFILE bumping behavior isn't implemented there, so
the test was testing the environment and not the Go project.

Updates #46279.
For #61116.
Fixes #63994.

Change-Id: Ic993f9cfc021d4cda4fe3d7fed8e2e180f78a2ca
Cq-Include-Trybots: luci.golang.try:go1.21-wasip1-wasm_wasmtime
Reviewed-on: https://go-review.googlesource.com/c/go/+/539435
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
(cherry picked from commit b7cbcf0c274a0e9f9703468c8ea1d511efe90c5e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/540615
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Heschi Kreinick <heschi@google.com>
src/syscall/rlimit_test.go