88)
99
1010func TestIsNetworkError (t * testing.T ) {
11+ t .Parallel ()
12+
1113 tests := []struct {
1214 name string
1315 errorMsg string
@@ -37,6 +39,7 @@ func TestIsNetworkError(t *testing.T) {
3739
3840 for _ , tt := range tests {
3941 t .Run (tt .name , func (t * testing.T ) {
42+ t .Parallel ()
4043 if got := isNetworkError (tt .errorMsg ); got != tt .want {
4144 t .Errorf ("isNetworkError() = %v, want %v" , got , tt .want )
4245 }
@@ -45,6 +48,8 @@ func TestIsNetworkError(t *testing.T) {
4548}
4649
4750func TestIsHTTPError (t * testing.T ) {
51+ t .Parallel ()
52+
4853 tests := []struct {
4954 name string
5055 errorMsg string
@@ -74,6 +79,7 @@ func TestIsHTTPError(t *testing.T) {
7479
7580 for _ , tt := range tests {
7681 t .Run (tt .name , func (t * testing.T ) {
82+ t .Parallel ()
7783 if got := isHTTPError (tt .errorMsg ); got != tt .want {
7884 t .Errorf ("isHTTPError() = %v, want %v" , got , tt .want )
7985 }
@@ -82,6 +88,8 @@ func TestIsHTTPError(t *testing.T) {
8288}
8389
8490func TestNewScrapeSuccessMetric (t * testing.T ) {
91+ t .Parallel ()
92+
8593 metric := newScrapeSuccessMetric ("nginx" , map [string ]string {"job" : "nginx" })
8694
8795 if metric == nil {
@@ -95,6 +103,8 @@ func TestNewScrapeSuccessMetric(t *testing.T) {
95103}
96104
97105func TestNewScrapeDurationMetric (t * testing.T ) {
106+ t .Parallel ()
107+
98108 metric := newScrapeDurationMetric ("nginx" , map [string ]string {"job" : "nginx" })
99109
100110 if metric == nil {
@@ -108,10 +118,13 @@ func TestNewScrapeDurationMetric(t *testing.T) {
108118}
109119
110120func TestNewScrapeErrorsTotalMetric (t * testing.T ) {
121+ t .Parallel ()
122+
111123 metric := newScrapeErrorsTotalMetric ("nginx" , map [string ]string {"job" : "nginx" })
112124
113125 if metric == nil {
114126 t .Error ("newScrapeErrorsTotalMetric() returned nil" )
127+ return
115128 }
116129
117130 ch := make (chan * prometheus.Desc , 10 )
0 commit comments