Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f961434f33 |
@@ -94,9 +94,7 @@ func interruptOnFirstRequest(t *testing.T, requestArrived <-chan struct{}) {
|
||||
testEnded := make(chan struct{})
|
||||
senderDone := make(chan struct{})
|
||||
|
||||
// Stop catching SIGINT only after the sender has returned. The sender
|
||||
// waits for each SIGINT it sends to arrive on caught; one still on
|
||||
// its way after signal.Stop would kill the test binary.
|
||||
// The sender must have stopped before the test stops catching SIGINT.
|
||||
t.Cleanup(func() {
|
||||
close(testEnded)
|
||||
<-senderDone
|
||||
@@ -116,13 +114,6 @@ func interruptOnFirstRequest(t *testing.T, requestArrived <-chan struct{}) {
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
// Empty caught, so that the receive below waits for this
|
||||
// SIGINT rather than an earlier one.
|
||||
select {
|
||||
case <-caught:
|
||||
default:
|
||||
}
|
||||
|
||||
sendErr := self.Signal(os.Interrupt)
|
||||
if sendErr != nil {
|
||||
t.Errorf("sending SIGINT: %v", sendErr)
|
||||
@@ -130,8 +121,6 @@ func interruptOnFirstRequest(t *testing.T, requestArrived <-chan struct{}) {
|
||||
return
|
||||
}
|
||||
|
||||
<-caught
|
||||
|
||||
select {
|
||||
case <-testEnded:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user