@@ -38,6 +38,8 @@ import (
38
38
)
39
39
40
40
func TestClientRequest (t * testing.T ) {
41
+ t .Parallel ()
42
+
41
43
server := newTestServer ()
42
44
defer server .Stop ()
43
45
client := DialInProc (server )
@@ -53,6 +55,8 @@ func TestClientRequest(t *testing.T) {
53
55
}
54
56
55
57
func TestClientResponseType (t * testing.T ) {
58
+ t .Parallel ()
59
+
56
60
server := newTestServer ()
57
61
defer server .Stop ()
58
62
client := DialInProc (server )
@@ -71,6 +75,8 @@ func TestClientResponseType(t *testing.T) {
71
75
72
76
// This test checks calling a method that returns 'null'.
73
77
func TestClientNullResponse (t * testing.T ) {
78
+ t .Parallel ()
79
+
74
80
server := newTestServer ()
75
81
defer server .Stop ()
76
82
@@ -91,6 +97,8 @@ func TestClientNullResponse(t *testing.T) {
91
97
92
98
// This test checks that server-returned errors with code and data come out of Client.Call.
93
99
func TestClientErrorData (t * testing.T ) {
100
+ t .Parallel ()
101
+
94
102
server := newTestServer ()
95
103
defer server .Stop ()
96
104
client := DialInProc (server )
@@ -121,6 +129,8 @@ func TestClientErrorData(t *testing.T) {
121
129
}
122
130
123
131
func TestClientBatchRequest (t * testing.T ) {
132
+ t .Parallel ()
133
+
124
134
server := newTestServer ()
125
135
defer server .Stop ()
126
136
client := DialInProc (server )
@@ -172,6 +182,8 @@ func TestClientBatchRequest(t *testing.T) {
172
182
// This checks that, for HTTP connections, the length of batch responses is validated to
173
183
// match the request exactly.
174
184
func TestClientBatchRequest_len (t * testing.T ) {
185
+ t .Parallel ()
186
+
175
187
b , err := json .Marshal ([]jsonrpcMessage {
176
188
{Version : "2.0" , ID : json .RawMessage ("1" ), Result : json .RawMessage (`"0x1"` )},
177
189
{Version : "2.0" , ID : json .RawMessage ("2" ), Result : json .RawMessage (`"0x2"` )},
@@ -188,6 +200,8 @@ func TestClientBatchRequest_len(t *testing.T) {
188
200
t .Cleanup (s .Close )
189
201
190
202
t .Run ("too-few" , func (t * testing.T ) {
203
+ t .Parallel ()
204
+
191
205
client , err := Dial (s .URL )
192
206
if err != nil {
193
207
t .Fatal ("failed to dial test server:" , err )
@@ -218,6 +232,8 @@ func TestClientBatchRequest_len(t *testing.T) {
218
232
})
219
233
220
234
t .Run ("too-many" , func (t * testing.T ) {
235
+ t .Parallel ()
236
+
221
237
client , err := Dial (s .URL )
222
238
if err != nil {
223
239
t .Fatal ("failed to dial test server:" , err )
@@ -249,6 +265,8 @@ func TestClientBatchRequest_len(t *testing.T) {
249
265
// This checks that the client can handle the case where the server doesn't
250
266
// respond to all requests in a batch.
251
267
func TestClientBatchRequestLimit (t * testing.T ) {
268
+ t .Parallel ()
269
+
252
270
server := newTestServer ()
253
271
defer server .Stop ()
254
272
server .SetBatchLimits (2 , 100000 )
@@ -285,6 +303,8 @@ func TestClientBatchRequestLimit(t *testing.T) {
285
303
}
286
304
287
305
func TestClientNotify (t * testing.T ) {
306
+ t .Parallel ()
307
+
288
308
server := newTestServer ()
289
309
defer server .Stop ()
290
310
client := DialInProc (server )
@@ -392,6 +412,8 @@ func testClientCancel(transport string, t *testing.T) {
392
412
}
393
413
394
414
func TestClientSubscribeInvalidArg (t * testing.T ) {
415
+ t .Parallel ()
416
+
395
417
server := newTestServer ()
396
418
defer server .Stop ()
397
419
client := DialInProc (server )
@@ -422,6 +444,8 @@ func TestClientSubscribeInvalidArg(t *testing.T) {
422
444
}
423
445
424
446
func TestClientSubscribe (t * testing.T ) {
447
+ t .Parallel ()
448
+
425
449
server := newTestServer ()
426
450
defer server .Stop ()
427
451
client := DialInProc (server )
@@ -454,6 +478,8 @@ func TestClientSubscribe(t *testing.T) {
454
478
455
479
// In this test, the connection drops while Subscribe is waiting for a response.
456
480
func TestClientSubscribeClose (t * testing.T ) {
481
+ t .Parallel ()
482
+
457
483
server := newTestServer ()
458
484
service := & notificationTestService {
459
485
gotHangSubscriptionReq : make (chan struct {}),
@@ -498,6 +524,8 @@ func TestClientSubscribeClose(t *testing.T) {
498
524
// This test reproduces https://github.com/ethereum/go-ethereum/issues/17837 where the
499
525
// client hangs during shutdown when Unsubscribe races with Client.Close.
500
526
func TestClientCloseUnsubscribeRace (t * testing.T ) {
527
+ t .Parallel ()
528
+
501
529
server := newTestServer ()
502
530
defer server .Stop ()
503
531
@@ -540,6 +568,8 @@ func (b *unsubscribeBlocker) readBatch() ([]*jsonrpcMessage, bool, error) {
540
568
// not respond.
541
569
// It reproducers the issue https://github.com/ethereum/go-ethereum/issues/30156
542
570
func TestUnsubscribeTimeout (t * testing.T ) {
571
+ t .Parallel ()
572
+
543
573
srv := NewServer ()
544
574
srv .RegisterName ("nftest" , new (notificationTestService ))
545
575
@@ -674,6 +704,8 @@ func TestClientSubscriptionChannelClose(t *testing.T) {
674
704
// This test checks that Client doesn't lock up when a single subscriber
675
705
// doesn't read subscription events.
676
706
func TestClientNotificationStorm (t * testing.T ) {
707
+ t .Parallel ()
708
+
677
709
server := newTestServer ()
678
710
defer server .Stop ()
679
711
@@ -726,6 +758,8 @@ func TestClientNotificationStorm(t *testing.T) {
726
758
}
727
759
728
760
func TestClientSetHeader (t * testing.T ) {
761
+ t .Parallel ()
762
+
729
763
var gotHeader bool
730
764
srv := newTestServer ()
731
765
httpsrv := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
@@ -762,6 +796,8 @@ func TestClientSetHeader(t *testing.T) {
762
796
}
763
797
764
798
func TestClientHTTP (t * testing.T ) {
799
+ t .Parallel ()
800
+
765
801
server := newTestServer ()
766
802
defer server .Stop ()
767
803
@@ -804,6 +840,8 @@ func TestClientHTTP(t *testing.T) {
804
840
}
805
841
806
842
func TestClientReconnect (t * testing.T ) {
843
+ t .Parallel ()
844
+
807
845
startServer := func (addr string ) (* Server , net.Listener ) {
808
846
srv := newTestServer ()
809
847
l , err := net .Listen ("tcp" , addr )
0 commit comments