@@ -159,7 +159,7 @@ func (s) TestReportLoad_ConnectionCreation(t *testing.T) {
159
159
t .Fatal ("Timeout when waiting for LRS stream to be created" )
160
160
}
161
161
162
- // Call the load reporting API to report load to the second management
162
+ // Call the load reporting API to report load to the first management
163
163
// server, and ensure that a connection to the server is created.
164
164
serverIdentifier2 := clients.ServerIdentifier {ServerURI : mgmtServer2 .Address , Extensions : grpctransport.ServerIdentifierExtension {ConfigName : "insecure" }}
165
165
loadStore2 , err := client .ReportLoad (serverIdentifier2 )
@@ -199,11 +199,10 @@ func (s) TestReportLoad_ConnectionCreation(t *testing.T) {
199
199
}
200
200
201
201
// Send a response from the server with a small deadline.
202
- serverReportInterval := 50 * time .Millisecond
203
202
lrsServer .LRSResponseChan <- & fakeserver.Response {
204
203
Resp : & v3lrspb.LoadStatsResponse {
205
204
SendAllClusters : true ,
206
- LoadReportingInterval : & durationpb.Duration {Nanos : int32 ( serverReportInterval . Nanoseconds ()) }, // 50ms
205
+ LoadReportingInterval : & durationpb.Duration {Nanos : 50000000 }, // 50ms
207
206
},
208
207
}
209
208
@@ -217,19 +216,6 @@ func (s) TestReportLoad_ConnectionCreation(t *testing.T) {
217
216
t .Fatalf ("Received load for %d clusters, want 1" , l )
218
217
}
219
218
220
- // Verify that LoadReportInterval for the first load report is positive but
221
- // not excessively large.
222
- //
223
- // Max expected: serverReportInterval + tolerance (e.g., 500ms).
224
- firstLoadReportInterval := gotLoad [0 ].GetLoadReportInterval ().AsDuration ()
225
- if firstLoadReportInterval <= 0 {
226
- t .Fatalf ("First LoadReportInterval = %v, want > 0" , firstLoadReportInterval )
227
- }
228
- tolerance := 500 * time .Millisecond
229
- if firstLoadReportInterval > serverReportInterval + tolerance {
230
- t .Errorf ("First LoadReportInterval is unexpectedly large: %v" , firstLoadReportInterval )
231
- }
232
-
233
219
// This field is set by the client to indicate the actual time elapsed since
234
220
// the last report was sent. We cannot deterministically compare this, and
235
221
// we cannot use the cmpopts.IgnoreFields() option on proto structs, since
@@ -338,11 +324,10 @@ func (s) TestReportLoad_StreamCreation(t *testing.T) {
338
324
}
339
325
340
326
// Send a response from the server with a small deadline.
341
- serverReportInterval := 50 * time .Millisecond
342
327
lrsServer .LRSResponseChan <- & fakeserver.Response {
343
328
Resp : & v3lrspb.LoadStatsResponse {
344
329
SendAllClusters : true ,
345
- LoadReportingInterval : & durationpb.Duration {Nanos : int32 ( serverReportInterval . Nanoseconds ()) }, // 50ms
330
+ LoadReportingInterval : & durationpb.Duration {Nanos : 50000000 }, // 50ms
346
331
},
347
332
}
348
333
@@ -356,19 +341,6 @@ func (s) TestReportLoad_StreamCreation(t *testing.T) {
356
341
t .Fatalf ("Received load for %d clusters, want 1" , l )
357
342
}
358
343
359
- // Verify that LoadReportInterval for the first load report is positive but
360
- // not excessively large.
361
- //
362
- // Max expected: serverReportInterval + tolerance (e.g., 500ms).
363
- firstLoadReportInterval := gotLoad [0 ].GetLoadReportInterval ().AsDuration ()
364
- if firstLoadReportInterval <= 0 {
365
- t .Fatalf ("First LoadReportInterval for cluster1 = %v, want > 0" , firstLoadReportInterval )
366
- }
367
- tolerance := 500 * time .Millisecond
368
- if firstLoadReportInterval > serverReportInterval + tolerance {
369
- t .Errorf ("First LoadReportInterval for cluster1 is unexpectedly large: %v" , firstLoadReportInterval )
370
- }
371
-
372
344
// This field is set by the client to indicate the actual time elapsed since
373
345
// the last report was sent. We cannot deterministically compare this, and
374
346
// we cannot use the cmpopts.IgnoreFields() option on proto structs, since
@@ -434,17 +406,6 @@ func (s) TestReportLoad_StreamCreation(t *testing.T) {
434
406
if l := len (gotLoad ); l != 1 {
435
407
continue
436
408
}
437
- // Verify that LoadReportInterval for the subsequent load reports is
438
- // positive but not excessively large.
439
- //
440
- // Max expected: serverReportInterval + tolerance (e.g., 500ms).
441
- loadReportInterval := gotLoad [0 ].GetLoadReportInterval ().AsDuration ()
442
- if loadReportInterval <= 0 {
443
- t .Fatalf ("LoadReportInterval = %v, want > 0" , firstLoadReportInterval )
444
- }
445
- if loadReportInterval > serverReportInterval + tolerance {
446
- t .Errorf ("LoadReportInterval is unexpectedly large: %v" , loadReportInterval )
447
- }
448
409
gotLoad [0 ].LoadReportInterval = nil
449
410
wantLoad := & v3endpointpb.ClusterStats {
450
411
ClusterName : "cluster2" ,
@@ -551,11 +512,10 @@ func (s) TestReportLoad_StopWithContext(t *testing.T) {
551
512
}
552
513
553
514
// Send a response from the server with a small deadline.
554
- serverReportInterval := 50 * time .Millisecond
555
515
lrsServer .LRSResponseChan <- & fakeserver.Response {
556
516
Resp : & v3lrspb.LoadStatsResponse {
557
517
SendAllClusters : true ,
558
- LoadReportingInterval : & durationpb.Duration {Nanos : int32 ( serverReportInterval . Nanoseconds ()) }, // 50ms
518
+ LoadReportingInterval : & durationpb.Duration {Nanos : 50000000 }, // 50ms
559
519
},
560
520
}
561
521
@@ -569,19 +529,6 @@ func (s) TestReportLoad_StopWithContext(t *testing.T) {
569
529
t .Fatalf ("Received load for %d clusters, want 1" , l )
570
530
}
571
531
572
- // Verify that LoadReportInterval for the first load report is positive but
573
- // not excessively large.
574
- //
575
- // Max expected: serverReportInterval + tolerance (e.g., 500ms).
576
- firstLoadReportInterval := gotLoad [0 ].GetLoadReportInterval ().AsDuration ()
577
- if firstLoadReportInterval <= 0 {
578
- t .Fatalf ("First LoadReportInterval = %v, want > 0" , firstLoadReportInterval )
579
- }
580
- tolerance := 500 * time .Millisecond
581
- if firstLoadReportInterval > serverReportInterval + tolerance {
582
- t .Errorf ("First LoadReportInterval is unexpectedly large: %v" , firstLoadReportInterval )
583
- }
584
-
585
532
// This field is set by the client to indicate the actual time elapsed since
586
533
// the last report was sent. We cannot deterministically compare this, and
587
534
// we cannot use the cmpopts.IgnoreFields() option on proto structs, since
@@ -644,17 +591,6 @@ func (s) TestReportLoad_StopWithContext(t *testing.T) {
644
591
if l := len (gotLoad ); l != 1 {
645
592
continue
646
593
}
647
- // Verify that LoadReportInterval for the subsequent load reports is
648
- // positive but not excessively large.
649
- //
650
- // Max expected: serverReportInterval + tolerance (e.g., 500ms).
651
- loadReportInterval := gotLoad [0 ].GetLoadReportInterval ().AsDuration ()
652
- if loadReportInterval <= 0 {
653
- t .Fatalf ("LoadReportInterval = %v, want > 0" , firstLoadReportInterval )
654
- }
655
- if loadReportInterval > serverReportInterval + tolerance {
656
- t .Errorf ("LoadReportInterval is unexpectedly large: %v" , loadReportInterval )
657
- }
658
594
gotLoad [0 ].LoadReportInterval = nil
659
595
wantLoad := & v3endpointpb.ClusterStats {
660
596
ClusterName : "cluster2" ,
0 commit comments