diff --git a/e2e/ctl_v3_elect_test.go b/e2e/ctl_v3_elect_test.go index 3da54278099e..9bce4cd7265c 100644 --- a/e2e/ctl_v3_elect_test.go +++ b/e2e/ctl_v3_elect_test.go @@ -17,15 +17,32 @@ package e2e import ( "os" "strings" + "syscall" "testing" "time" "github.com/coreos/etcd/pkg/expect" ) -func TestCtlV3Elect(t *testing.T) { testCtl(t, testElect) } +func TestCtlV3Elect(t *testing.T) { + oldenv := os.Getenv("EXPECT_DEBUG") + defer os.Setenv("EXPECT_DEBUG", oldenv) + os.Setenv("EXPECT_DEBUG", "1") + + testCtl(t, testElect) +} func testElect(cx ctlCtx) { + // debugging for #6934 + for _, p := range cx.epc.procs { + p.proc.StopSignal = syscall.SIGQUIT + } + defer func() { + for _, ep := range cx.epc.procs { + ep.proc.StopSignal = os.Interrupt + } + }() + name := "a" holder, ch, err := ctlV3Elect(cx, name, "p1") @@ -102,6 +119,7 @@ func ctlV3Elect(cx ctlCtx, name, proposal string) (*expect.ExpectProcess, <-chan close(outc) return proc, outc, err } + proc.StopSignal = syscall.SIGQUIT go func() { s, xerr := proc.ExpectFunc(func(string) bool { return true }) if xerr != nil { diff --git a/e2e/ctl_v3_lock_test.go b/e2e/ctl_v3_lock_test.go index e380f7cd843f..c9b4233aab32 100644 --- a/e2e/ctl_v3_lock_test.go +++ b/e2e/ctl_v3_lock_test.go @@ -17,15 +17,32 @@ package e2e import ( "os" "strings" + "syscall" "testing" "time" "github.com/coreos/etcd/pkg/expect" ) -func TestCtlV3Lock(t *testing.T) { testCtl(t, testLock) } +func TestCtlV3Lock(t *testing.T) { + oldenv := os.Getenv("EXPECT_DEBUG") + defer os.Setenv("EXPECT_DEBUG", oldenv) + os.Setenv("EXPECT_DEBUG", "1") + + testCtl(t, testLock) +} func testLock(cx ctlCtx) { + // debugging for #6464 + for _, p := range cx.epc.procs { + p.proc.StopSignal = syscall.SIGQUIT + } + defer func() { + for _, ep := range cx.epc.procs { + ep.proc.StopSignal = os.Interrupt + } + }() + name := "a" holder, ch, err := ctlV3Lock(cx, name) @@ -102,6 +119,7 @@ func ctlV3Lock(cx ctlCtx, name string) (*expect.ExpectProcess, <-chan string, er close(outc) return proc, outc, err } + proc.StopSignal = syscall.SIGQUIT go func() { s, xerr := proc.ExpectFunc(func(string) bool { return true }) if xerr != nil {