mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os/signal: deflake TestReset/TestIgnore
Fixes #15661. Change-Id: Ic3a8296fc7107f491880900ef52563e52caca1a3 Reviewed-on: https://go-review.googlesource.com/23615 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
52fe472472
commit
bc4fdfdbfe
1 changed files with 13 additions and 0 deletions
|
|
@ -139,6 +139,19 @@ func testCancel(t *testing.T, ignore bool) {
|
||||||
Reset(syscall.SIGWINCH, syscall.SIGHUP)
|
Reset(syscall.SIGWINCH, syscall.SIGHUP)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// At this point we do not expect any further signals on c1.
|
||||||
|
// However, it is just barely possible that the initial SIGWINCH
|
||||||
|
// at the start of this function was delivered after we called
|
||||||
|
// Notify on c1. In that case the waitSig for SIGWINCH may have
|
||||||
|
// picked up that initial SIGWINCH, and the second SIGWINCH may
|
||||||
|
// then have been delivered on the channel. This sequence of events
|
||||||
|
// may have caused issue 15661.
|
||||||
|
// So, read any possible signal from the channel now.
|
||||||
|
select {
|
||||||
|
case <-c1:
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
// Send this process a SIGWINCH. It should be ignored.
|
// Send this process a SIGWINCH. It should be ignored.
|
||||||
syscall.Kill(syscall.Getpid(), syscall.SIGWINCH)
|
syscall.Kill(syscall.Getpid(), syscall.SIGWINCH)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue