Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dbtest/dbserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net"
"os"
"os/exec"
"runtime"
"strconv"
"time"

Expand Down Expand Up @@ -70,7 +71,7 @@ func (dbs *DBServer) start() {
err = dbs.server.Start()
if err != nil {
// print error to facilitate troubleshooting as the panic will be caught in a panic handler
fmt.Fprintf(os.Stderr, "mongod failed to start: %v\n",err)
fmt.Fprintf(os.Stderr, "mongod failed to start: %v\n", err)
panic(err)
}
dbs.tomb.Go(dbs.monitor)
Expand Down Expand Up @@ -113,7 +114,12 @@ func (dbs *DBServer) Stop() {
}
if dbs.server != nil {
dbs.tomb.Kill(nil)
dbs.server.Process.Signal(os.Interrupt)
// Windows doesn't support Interrupt
if runtime.GOOS == "windows" {
dbs.server.Process.Signal(os.Kill)
} else {
dbs.server.Process.Signal(os.Interrupt)
}
select {
case <-dbs.tomb.Dead():
case <-time.After(5 * time.Second):
Expand Down