summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--integrations/integration_test.go2
-rw-r--r--integrations/testlogger.go21
2 files changed, 23 insertions, 0 deletions
diff --git a/integrations/integration_test.go b/integrations/integration_test.go
index 4263fa4805..b23c28ee57 100644
--- a/integrations/integration_test.go
+++ b/integrations/integration_test.go
@@ -81,6 +81,8 @@ func TestMain(m *testing.M) {
}
exitCode := m.Run()
+ writerCloser.t = nil
+
if err = os.RemoveAll(setting.Indexer.IssuePath); err != nil {
fmt.Printf("os.RemoveAll: %v\n", err)
os.Exit(1)
diff --git a/integrations/testlogger.go b/integrations/testlogger.go
index 9ee28d2ead..c50daead9b 100644
--- a/integrations/testlogger.go
+++ b/integrations/testlogger.go
@@ -33,6 +33,27 @@ func (w *testLoggerWriterCloser) Write(p []byte) (int, error) {
if len(p) > 0 && p[len(p)-1] == '\n' {
p = p[:len(p)-1]
}
+
+ defer func() {
+ err := recover()
+ if err == nil {
+ return
+ }
+ var errString string
+ errErr, ok := err.(error)
+ if ok {
+ errString = errErr.Error()
+ } else {
+ errString, ok = err.(string)
+ }
+ if !ok {
+ panic(err)
+ }
+ if !strings.HasPrefix(errString, "Log in goroutine after ") {
+ panic(err)
+ }
+ }()
+
w.t.Log(string(p))
return len(p), nil
}