Skip to content

Commit e3eaedb

Browse files
hanchaoqunianlancetaylor
authored andcommitted
os/signal: reset SIGURG in TestSignal
Accepting SIGURG signals could cause SIGURG to take up the entire channel buffer. Enhance the stability of test cases by: 1. Stop accepting the SIGURG signal by adding ‘Reset(sys call.SIGURG)’ 2. Close the c1 chan by adding ‘defer Stop(c1)’ (Another bug, NOT this bug) Fixes golang#49724 Change-Id: I909a9993f0f6dd109c15e48a861683b87dfc4ab3 Reviewed-on: https://go-review.googlesource.com/c/go/+/366514 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Trust: Bryan C. Mills <bcmills@google.com>
1 parent 0f64c21 commit e3eaedb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/os/signal/signal_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ func TestSignal(t *testing.T) {
136136
// Using 10 is arbitrary.
137137
c1 := make(chan os.Signal, 10)
138138
Notify(c1)
139+
// Stop relaying the SIGURG signals. See #49724
140+
Reset(syscall.SIGURG)
141+
defer Stop(c1)
139142

140143
// Send this process a SIGWINCH
141144
t.Logf("sigwinch...")

0 commit comments

Comments
 (0)