Skip to content

Commit

Permalink
e2e: use SIGTERM instead of SIGINT for etcdctl tests
Browse files Browse the repository at this point in the history
SIGINT needs special handling for ptys, causing some environments
to not deliver the signal. Use SIGTERM instead.
  • Loading branch information
Anthony Romano committed Aug 2, 2017
1 parent 0750965 commit 2b61463
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions e2e/ctl_v3_elect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package e2e
import (
"os"
"strings"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -77,15 +78,17 @@ func testElect(cx ctlCtx) {
}

// kill blocked process with clean shutdown
if err = blocked.Signal(os.Interrupt); err != nil {
// NB: this was os.Interrupt but depending on how CI is launched
// the SIGINT can be blocked from delivery to the etcdctl via pty.
if err = blocked.Signal(syscall.SIGTERM); err != nil {
cx.t.Fatal(err)
}
if err = closeWithTimeout(blocked, time.Second); err != nil {
cx.t.Fatal(err)
}

// kill the holder with clean shutdown
if err = holder.Signal(os.Interrupt); err != nil {
if err = holder.Signal(syscall.SIGTERM); err != nil {
cx.t.Fatal(err)
}
if err = closeWithTimeout(holder, time.Second); err != nil {
Expand Down

0 comments on commit 2b61463

Please sign in to comment.