diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go index 7cba1d80..45ec0d67 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter_test.go +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -10,11 +10,12 @@ import ( "strings" "testing" - "github.com/percona/percona-toolkit/src/go/lib/tutil" - "github.com/percona/percona-toolkit/src/go/mongolib/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.mongodb.org/mongo-driver/bson" + + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" ) const ( @@ -33,7 +34,8 @@ func TestMain(m *testing.M) { log.Printf("cannot get root path: %s", err.Error()) os.Exit(1) } - os.Exit(m.Run()) + code := m.Run() + os.Exit(code) } func TestSingleFingerprint(t *testing.T) { diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index b16796d8..9b1dc4ab 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -7,14 +7,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.mongodb.org/mongo-driver/bson/primitive" + tu "github.com/percona/percona-toolkit/src/go/internal/testutils" "github.com/percona/percona-toolkit/src/go/lib/tutil" "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/stats" "github.com/percona/percona-toolkit/src/go/pt-mongodb-query-digest/filter" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.mongodb.org/mongo-driver/bson/primitive" ) const ( @@ -38,7 +39,8 @@ func TestMain(m *testing.M) { log.Printf("cannot get root path: %s", err.Error()) os.Exit(1) } - os.Exit(m.Run()) + code := m.Run() + os.Exit(code) } func TestRegularIterator(t *testing.T) { diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 2ebe7890..90afa038 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -14,6 +14,7 @@ import ( "time" "github.com/golang/mock/gomock" + "github.com/percona/percona-toolkit/src/go/lib/tutil" "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/proto" @@ -40,8 +41,8 @@ func TestMain(m *testing.M) { log.Printf("cannot get root path: %s", err.Error()) os.Exit(1) } - // TODO: Review with the new sandbox - // os.Exit(m.Run()) + code := m.Run() + os.Exit(code) } func TestTimesLen(t *testing.T) { diff --git a/src/go/pt-pg-summary/main_test.go b/src/go/pt-pg-summary/main_test.go index 5319ecd5..cfc0a02a 100644 --- a/src/go/pt-pg-summary/main_test.go +++ b/src/go/pt-pg-summary/main_test.go @@ -32,7 +32,8 @@ var logger = logrus.New() func TestMain(m *testing.M) { logger.SetLevel(logrus.WarnLevel) - os.Exit(m.Run()) + code := m.Run() + os.Exit(code) } func TestConnection(t *testing.T) {