Add 0004-syscall-remove-TestRlimit.diff

Until it gets removed in rc2
This commit is contained in:
Alejandro Sáez 2022-03-08 17:11:38 +01:00
parent 48eb2b7f8e
commit d6f0425b10
2 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,62 @@
From 520f0d04017dff65314ce54a45e4b8212f0bfb87 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Fri, 04 Mar 2022 10:03:32 -0800
Subject: [PATCH] [release-branch.go1.18] syscall: remove TestRlimit
It's more trouble than it's worth. New code should be using x/sys/unix
anyhow.
Fixes #40564
Fixes #51479
Change-Id: I1c0e13f494380c1565e98359f088af9f52790b79
Reviewed-on: https://go-review.googlesource.com/c/go/+/390020
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 1e122e3894bd12407b0043ab25c2a5f665b3f6e5)
Reviewed-on: https://go-review.googlesource.com/c/go/+/390022
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
---
diff --git a/src/syscall/syscall_unix_test.go b/src/syscall/syscall_unix_test.go
index 1ef2634..317c0c1 100644
--- a/src/syscall/syscall_unix_test.go
+++ b/src/syscall/syscall_unix_test.go
@@ -326,33 +326,6 @@
}
}
-func TestRlimit(t *testing.T) {
- var rlimit, zero syscall.Rlimit
- if err := syscall.Getrlimit(syscall.RLIMIT_CPU, &rlimit); err != nil {
- t.Fatalf("Getrlimit: save failed: %v", err)
- }
- if zero == rlimit {
- t.Fatalf("Getrlimit: save failed: got zero value %#v", rlimit)
- }
- set := rlimit
- set.Cur = set.Max - 1
- if err := syscall.Setrlimit(syscall.RLIMIT_CPU, &set); err != nil {
- t.Fatalf("Setrlimit: set failed: %#v %v", set, err)
- }
- var get syscall.Rlimit
- if err := syscall.Getrlimit(syscall.RLIMIT_CPU, &get); err != nil {
- t.Fatalf("Getrlimit: get failed: %v", err)
- }
- set = rlimit
- set.Cur = set.Max - 1
- if set != get {
- t.Fatalf("Rlimit: change failed: wanted %#v got %#v", set, get)
- }
- if err := syscall.Setrlimit(syscall.RLIMIT_CPU, &rlimit); err != nil {
- t.Fatalf("Setrlimit: restore failed: %#v %v", rlimit, err)
- }
-}
-
func TestSeekFailure(t *testing.T) {
_, err := syscall.Seek(-1, 0, io.SeekStart)
if err == nil {

View File

@ -114,7 +114,7 @@
%global go_source %{go_api}%{?go_patch:.%{go_patch}}%{?go_prerelease}
# For rpmdev-bumpspec and releng automation
%global baserelease 1
%global baserelease 2
Name: golang
Version: %{go_version}
@ -165,6 +165,7 @@ Requires: go-srpm-macros
Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch
Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch
Patch3: 0003-cmd-go-disable-Google-s-proxy-and-sumdb.patch
Patch4: 0004-syscall-remove-TestRlimit.diff
# Having documentation separate was broken
Obsoletes: %{name}-docs < 1.1-4
@ -541,6 +542,9 @@ fi
%endif
%changelog
* Tue Mar 08 2022 Alejandro Sáez <asm@redhat.com> - 1.18~rc1-2
- Add 0004-syscall-remove-TestRlimit.diff until it gets removed in rc2
* Thu Feb 17 2022 Mike Rochefort <mroche@redhat.com> - 1.18~rc1-1
- Update to 1.18rc1
- Resolves: rhbz#2002859