Skip to content

Commit

Permalink
Fix TestNoInitialKeyspace
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Aug 15, 2021
1 parent 88ad81f commit b7c3e87
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions go/test/endtoend/cluster/vtgate_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"reflect"
"strconv"
"strings"
"syscall"
"time"

"vitess.io/vitess/go/vt/log"
Expand Down Expand Up @@ -191,26 +192,21 @@ func (vtgate *VtgateProcess) TearDown() error {
return nil
}
// graceful shutdown is not currently working with vtgate, attempting a force-kill to make tests less flaky
vtgate.proc.Process.Kill()
vtgate.proc = nil
return nil
/*
// Attempt graceful shutdown with SIGTERM first
vtgate.proc.Process.Signal(syscall.SIGTERM)
// Attempt graceful shutdown with SIGTERM first
vtgate.proc.Process.Signal(syscall.SIGTERM)

// We are not checking vtgate's exit code because it sometimes
// returns exit code 2, even though vtgate terminates cleanly.
select {
case <-vtgate.exit:
vtgate.proc = nil
return nil
// We are not checking vtgate's exit code because it sometimes
// returns exit code 2, even though vtgate terminates cleanly.
select {
case <-vtgate.exit:
vtgate.proc = nil
return nil

case <-time.After(30 * time.Second):
vtgate.proc.Process.Kill()
vtgate.proc = nil
return <-vtgate.exit
}
*/
case <-time.After(30 * time.Second):
vtgate.proc.Process.Kill()
vtgate.proc = nil
return <-vtgate.exit
}
}

// VtgateProcessInstance returns a Vtgate handle for vtgate process
Expand Down

0 comments on commit b7c3e87

Please sign in to comment.