@@ -62,11 +62,11 @@ func TestRetryAfter(t *testing.T) {
62
62
},
63
63
}),
64
64
)
65
- res , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
65
+ _ , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
66
66
ConnectProtocolVersion : gitpod .F (gitpod .RunnerNewParamsConnectProtocolVersion1 ),
67
67
})
68
- if err == nil || res != nil {
69
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
68
+ if err == nil {
69
+ t .Error ("Expected there to be a cancel error" )
70
70
}
71
71
72
72
attempts := len (retryCountHeaders )
@@ -98,11 +98,11 @@ func TestDeleteRetryCountHeader(t *testing.T) {
98
98
}),
99
99
option .WithHeaderDel ("X-Stainless-Retry-Count" ),
100
100
)
101
- res , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
101
+ _ , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
102
102
ConnectProtocolVersion : gitpod .F (gitpod .RunnerNewParamsConnectProtocolVersion1 ),
103
103
})
104
- if err == nil || res != nil {
105
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
104
+ if err == nil {
105
+ t .Error ("Expected there to be a cancel error" )
106
106
}
107
107
108
108
expectedRetryCountHeaders := []string {"" , "" , "" }
@@ -129,11 +129,11 @@ func TestOverwriteRetryCountHeader(t *testing.T) {
129
129
}),
130
130
option .WithHeader ("X-Stainless-Retry-Count" , "42" ),
131
131
)
132
- res , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
132
+ _ , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
133
133
ConnectProtocolVersion : gitpod .F (gitpod .RunnerNewParamsConnectProtocolVersion1 ),
134
134
})
135
- if err == nil || res != nil {
136
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
135
+ if err == nil {
136
+ t .Error ("Expected there to be a cancel error" )
137
137
}
138
138
139
139
expectedRetryCountHeaders := []string {"42" , "42" , "42" }
@@ -159,11 +159,11 @@ func TestRetryAfterMs(t *testing.T) {
159
159
},
160
160
}),
161
161
)
162
- res , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
162
+ _ , err := client .Runners .New (context .Background (), gitpod.RunnerNewParams {
163
163
ConnectProtocolVersion : gitpod .F (gitpod .RunnerNewParamsConnectProtocolVersion1 ),
164
164
})
165
- if err == nil || res != nil {
166
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
165
+ if err == nil {
166
+ t .Error ("Expected there to be a cancel error" )
167
167
}
168
168
if want := 3 ; attempts != want {
169
169
t .Errorf ("Expected %d attempts, got %d" , want , attempts )
@@ -183,11 +183,11 @@ func TestContextCancel(t *testing.T) {
183
183
)
184
184
cancelCtx , cancel := context .WithCancel (context .Background ())
185
185
cancel ()
186
- res , err := client .Runners .New (cancelCtx , gitpod.RunnerNewParams {
186
+ _ , err := client .Runners .New (cancelCtx , gitpod.RunnerNewParams {
187
187
ConnectProtocolVersion : gitpod .F (gitpod .RunnerNewParamsConnectProtocolVersion1 ),
188
188
})
189
- if err == nil || res != nil {
190
- t .Error ("Expected there to be a cancel error and for the response to be nil " )
189
+ if err == nil {
190
+ t .Error ("Expected there to be a cancel error" )
191
191
}
192
192
}
193
193
@@ -204,11 +204,11 @@ func TestContextCancelDelay(t *testing.T) {
204
204
)
205
205
cancelCtx , cancel := context .WithTimeout (context .Background (), 2 * time .Millisecond )
206
206
defer cancel ()
207
- res , err := client .Runners .New (cancelCtx , gitpod.RunnerNewParams {
207
+ _ , err := client .Runners .New (cancelCtx , gitpod.RunnerNewParams {
208
208
ConnectProtocolVersion : gitpod .F (gitpod .RunnerNewParamsConnectProtocolVersion1 ),
209
209
})
210
- if err == nil || res != nil {
211
- t .Error ("expected there to be a cancel error and for the response to be nil " )
210
+ if err == nil {
211
+ t .Error ("expected there to be a cancel error" )
212
212
}
213
213
}
214
214
@@ -231,11 +231,11 @@ func TestContextDeadline(t *testing.T) {
231
231
},
232
232
}),
233
233
)
234
- res , err := client .Runners .New (deadlineCtx , gitpod.RunnerNewParams {
234
+ _ , err := client .Runners .New (deadlineCtx , gitpod.RunnerNewParams {
235
235
ConnectProtocolVersion : gitpod .F (gitpod .RunnerNewParamsConnectProtocolVersion1 ),
236
236
})
237
- if err == nil || res != nil {
238
- t .Error ("expected there to be a deadline error and for the response to be nil " )
237
+ if err == nil {
238
+ t .Error ("expected there to be a deadline error" )
239
239
}
240
240
close (testDone )
241
241
}()
0 commit comments