99 "go.mongodb.org/mongo-driver/v2/internal/assert"
1010)
1111
12- //nolint:govet
1312func TestCalculateMaxTimeMS (t * testing.T ) {
1413 tests := []struct {
1514 name string
@@ -41,7 +40,7 @@ func TestCalculateMaxTimeMS(t *testing.T) {
4140 {
4241 name : "remaining timeout < rttMin" ,
4342 ctx : func () context.Context {
44- ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (1 * time .Millisecond ))
43+ ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (1 * time .Millisecond )) //nolint:govet
4544 return ctx
4645 }(),
4746 rttMin : 10 * time .Millisecond ,
@@ -52,7 +51,7 @@ func TestCalculateMaxTimeMS(t *testing.T) {
5251 {
5352 name : "normal positive result" ,
5453 ctx : func () context.Context {
55- ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (100 * time .Millisecond ))
54+ ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (100 * time .Millisecond )) //nolint:govet
5655 return ctx
5756 }(),
5857 wantZero : false ,
@@ -62,7 +61,7 @@ func TestCalculateMaxTimeMS(t *testing.T) {
6261 {
6362 name : "beyond maxInt32" ,
6463 ctx : func () context.Context {
65- ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (time .Duration (math .MaxInt32 + 1000 )* time .Millisecond ))
64+ ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (time .Duration (math .MaxInt32 + 1000 )* time .Millisecond )) //nolint:govet
6665 return ctx
6766 }(),
6867 wantZero : true ,
@@ -72,7 +71,7 @@ func TestCalculateMaxTimeMS(t *testing.T) {
7271 {
7372 name : "round up to 1ms" ,
7473 ctx : func () context.Context {
75- ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (999 * time .Microsecond ))
74+ ctx , _ := context .WithDeadline (context .Background (), time .Now ().Add (999 * time .Microsecond )) //nolint:govet
7675 return ctx
7776 }(),
7877 wantOk : true ,
0 commit comments