File: zstd_test.go

package info (click to toggle)
golang-github-klauspost-compress 1.11.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 22,892 kB
  • sloc: asm: 7,868; makefile: 12
file content (28 lines) | stat: -rw-r--r-- 427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package zstd

import (
	"fmt"
	"os"
	"runtime"
	"runtime/pprof"
	"testing"
	"time"
)

func TestMain(m *testing.M) {
	ec := m.Run()
	if ec == 0 && runtime.NumGoroutine() > 1 {
		n := 0
		for n < 60 {
			n++
			time.Sleep(time.Second)
			if runtime.NumGoroutine() == 1 {
				os.Exit(0)
			}
		}
		fmt.Println("goroutines:", runtime.NumGoroutine())
		pprof.Lookup("goroutine").WriteTo(os.Stderr, 1)
		os.Exit(1)
	}
	os.Exit(ec)
}