diff --git a/client/logimport_test.go b/client/logimport_test.go index 656d893f0..64d7a72f6 100644 --- a/client/logimport_test.go +++ b/client/logimport_test.go @@ -91,7 +91,8 @@ func TestEncodeDecode(t *testing.T) { }) } - buf, err := os.CreateTemp("", "") + td := t.TempDir() + buf, err := os.CreateTemp(td, "") if err != nil { t.Fatalf("getting temp file: %v", err) } diff --git a/client/main_test.go b/client/main_test.go new file mode 100644 index 000000000..4d9cd99cd --- /dev/null +++ b/client/main_test.go @@ -0,0 +1,30 @@ +// Copyright 2021 Molecula Corp. All rights reserved. +package client_test + +import ( + "fmt" + "net" + "testing" + + "net/http" + _ "net/http/pprof" + + "github.com/molecula/featurebase/v3/testhook" +) + +func TestMain(m *testing.M) { + l, err := net.Listen("tcp", "localhost:0") + if err != nil { + panic(err) + } + port := l.Addr().(*net.TCPAddr).Port + fmt.Printf("client/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) + go func() { + err := http.Serve(l, nil) + if err != nil { + panic(err) + } + }() + testhook.RunTestsWithHooks(m) + +} diff --git a/main_test.go b/main_test.go index 0201c922a..88be457f5 100644 --- a/main_test.go +++ b/main_test.go @@ -18,7 +18,7 @@ func TestMain(m *testing.M) { panic(err) } port := l.Addr().(*net.TCPAddr).Port - fmt.Printf("pilosa/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) + fmt.Printf("featurebase/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) go func() { err := http.Serve(l, nil) if err != nil { diff --git a/sql/main_test.go b/sql/main_test.go new file mode 100644 index 000000000..99079412c --- /dev/null +++ b/sql/main_test.go @@ -0,0 +1,30 @@ +// Copyright 2021 Molecula Corp. All rights reserved. +package sql_test + +import ( + "fmt" + "net" + "testing" + + "net/http" + _ "net/http/pprof" + + "github.com/molecula/featurebase/v3/testhook" +) + +func TestMain(m *testing.M) { + l, err := net.Listen("tcp", "localhost:0") + if err != nil { + panic(err) + } + port := l.Addr().(*net.TCPAddr).Port + fmt.Printf("sql/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) + go func() { + err := http.Serve(l, nil) + if err != nil { + panic(err) + } + }() + testhook.RunTestsWithHooks(m) + +} diff --git a/sql3/main_test.go b/sql3/main_test.go new file mode 100644 index 000000000..9412199d4 --- /dev/null +++ b/sql3/main_test.go @@ -0,0 +1,30 @@ +// Copyright 2021 Molecula Corp. All rights reserved. +package sql3_test + +import ( + "fmt" + "net" + "testing" + + "net/http" + _ "net/http/pprof" + + "github.com/molecula/featurebase/v3/testhook" +) + +func TestMain(m *testing.M) { + l, err := net.Listen("tcp", "localhost:0") + if err != nil { + panic(err) + } + port := l.Addr().(*net.TCPAddr).Port + fmt.Printf("sql3/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) + go func() { + err := http.Serve(l, nil) + if err != nil { + panic(err) + } + }() + testhook.RunTestsWithHooks(m) + +} diff --git a/sql3/planner/main_test.go b/sql3/planner/main_test.go new file mode 100644 index 000000000..49993e6c9 --- /dev/null +++ b/sql3/planner/main_test.go @@ -0,0 +1,30 @@ +// Copyright 2021 Molecula Corp. All rights reserved. +package planner_test + +import ( + "fmt" + "net" + "testing" + + "net/http" + _ "net/http/pprof" + + "github.com/molecula/featurebase/v3/testhook" +) + +func TestMain(m *testing.M) { + l, err := net.Listen("tcp", "localhost:0") + if err != nil { + panic(err) + } + port := l.Addr().(*net.TCPAddr).Port + fmt.Printf("sql3/planner/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) + go func() { + err := http.Serve(l, nil) + if err != nil { + panic(err) + } + }() + testhook.RunTestsWithHooks(m) + +} diff --git a/stats/main_test.go b/stats/main_test.go new file mode 100644 index 000000000..11b29175f --- /dev/null +++ b/stats/main_test.go @@ -0,0 +1,30 @@ +// Copyright 2021 Molecula Corp. All rights reserved. +package stats_test + +import ( + "fmt" + "net" + "testing" + + "net/http" + _ "net/http/pprof" + + "github.com/molecula/featurebase/v3/testhook" +) + +func TestMain(m *testing.M) { + l, err := net.Listen("tcp", "localhost:0") + if err != nil { + panic(err) + } + port := l.Addr().(*net.TCPAddr).Port + fmt.Printf("stats/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) + go func() { + err := http.Serve(l, nil) + if err != nil { + panic(err) + } + }() + testhook.RunTestsWithHooks(m) + +} diff --git a/test/main_test.go b/test/main_test.go new file mode 100644 index 000000000..34b9c743d --- /dev/null +++ b/test/main_test.go @@ -0,0 +1,30 @@ +// Copyright 2021 Molecula Corp. All rights reserved. +package test_test + +import ( + "fmt" + "net" + "testing" + + "net/http" + _ "net/http/pprof" + + "github.com/molecula/featurebase/v3/testhook" +) + +func TestMain(m *testing.M) { + l, err := net.Listen("tcp", "localhost:0") + if err != nil { + panic(err) + } + port := l.Addr().(*net.TCPAddr).Port + fmt.Printf("test/ TestMain: online stack-traces: curl http://localhost:%v/debug/pprof/goroutine?debug=2\n", port) + go func() { + err := http.Serve(l, nil) + if err != nil { + panic(err) + } + }() + testhook.RunTestsWithHooks(m) + +}