@@ -41,7 +41,7 @@ func TestValidChangeStreamTimeouts(t *testing.T) {
4141 tests := []struct {
4242 name string
4343 ctxTimeout * time.Duration
44- timeout * time.Duration
44+ timeout time.Duration
4545 wantTimeout time.Duration
4646 want bool
4747 }{
@@ -54,43 +54,43 @@ func TestValidChangeStreamTimeouts(t *testing.T) {
5454 {
5555 name : "Timeout shorter than context deadline" ,
5656 ctxTimeout : ptrutil .Ptr (10 * time .Second ),
57- timeout : ptrutil . Ptr ( 1 * time .Second ) ,
57+ timeout : 1 * time .Second ,
5858 want : true ,
5959 },
6060 {
6161 name : "Timeout equal to context deadline" ,
6262 ctxTimeout : ptrutil .Ptr (1 * time .Second ),
63- timeout : ptrutil . Ptr ( 1 * time .Second ) ,
63+ timeout : 1 * time .Second ,
6464 want : false ,
6565 },
6666 {
6767 name : "Timeout greater than context deadline" ,
6868 ctxTimeout : ptrutil .Ptr (1 * time .Second ),
69- timeout : ptrutil . Ptr ( 10 * time .Second ) ,
69+ timeout : 10 * time .Second ,
7070 want : false ,
7171 },
7272 {
7373 name : "Context deadline already expired" ,
7474 ctxTimeout : ptrutil .Ptr (- 1 * time .Second ),
75- timeout : ptrutil . Ptr ( 1 * time .Second ) ,
75+ timeout : 1 * time .Second ,
7676 want : true , // *timeout <= 0 branch in code
7777 },
7878 {
7979 name : "Timeout is zero, context deadline in future" ,
8080 ctxTimeout : ptrutil .Ptr (10 * time .Second ),
81- timeout : ptrutil . Ptr ( 0 * time .Second ) ,
81+ timeout : 0 * time .Second ,
8282 want : true ,
8383 },
8484 {
8585 name : "Timeout is negative, context deadline in future" ,
8686 ctxTimeout : ptrutil .Ptr (10 * time .Second ),
87- timeout : ptrutil . Ptr ( - 1 * time .Second ) ,
87+ timeout : - 1 * time .Second ,
8888 want : true ,
8989 },
9090 {
9191 name : "Timeout provided, context has no deadline" ,
9292 ctxTimeout : nil ,
93- timeout : ptrutil . Ptr ( 1 * time .Second ) ,
93+ timeout : 1 * time .Second ,
9494 want : true ,
9595 },
9696 }
0 commit comments