@@ -254,8 +254,11 @@ func TestCloudFetchIterator(t *testing.T) {
254254 assert .ErrorContains (t , err3 , fmt .Sprintf ("%s %d" , "HTTP error" , http .StatusNotFound ))
255255 })
256256
257- t .Run ("should use custom HTTPClient when provided" , func (t * testing.T ) {
258- customClient := & http.Client {Timeout : 5 * time .Second }
257+ t .Run ("should use custom Transport when provided" , func (t * testing.T ) {
258+ customTransport := & http.Transport {
259+ MaxIdleConns : 10 ,
260+ MaxIdleConnsPerHost : 5 ,
261+ }
259262 requestCount := 0
260263
261264 handler = func (w http.ResponseWriter , r * http.Request ) {
@@ -281,7 +284,7 @@ func TestCloudFetchIterator(t *testing.T) {
281284 cfg := config .WithDefaults ()
282285 cfg .UseLz4Compression = false
283286 cfg .MaxDownloadThreads = 1
284- cfg .UserConfig .CloudFetchConfig . HTTPClient = customClient
287+ cfg .UserConfig .Transport = customTransport
285288
286289 bi , err := NewCloudBatchIterator (
287290 context .Background (),
@@ -291,21 +294,21 @@ func TestCloudFetchIterator(t *testing.T) {
291294 )
292295 assert .Nil (t , err )
293296
294- // Verify custom client is passed through the iterator chain
297+ // Verify custom transport is passed through the iterator chain
295298 wrapper , ok := bi .(* batchIterator )
296299 assert .True (t , ok )
297300 cbi , ok := wrapper .ipcIterator .(* cloudIPCStreamIterator )
298301 assert .True (t , ok )
299- assert .Equal (t , customClient , cbi .httpClient )
302+ assert .Equal (t , customTransport , cbi .transport )
300303
301- // Fetch should work with custom client
304+ // Fetch should work with custom transport
302305 sab1 , nextErr := bi .Next ()
303306 assert .Nil (t , nextErr )
304307 assert .NotNil (t , sab1 )
305308 assert .Greater (t , requestCount , 0 ) // Verify request was made
306309 })
307310
308- t .Run ("should use http.DefaultClient when HTTPClient is nil" , func (t * testing.T ) {
311+ t .Run ("should use http.DefaultClient when Transport is nil" , func (t * testing.T ) {
309312 handler = func (w http.ResponseWriter , r * http.Request ) {
310313 w .WriteHeader (http .StatusOK )
311314 _ , err := w .Write (generateMockArrowBytes (generateArrowRecord ()))
@@ -328,7 +331,7 @@ func TestCloudFetchIterator(t *testing.T) {
328331 cfg := config .WithDefaults ()
329332 cfg .UseLz4Compression = false
330333 cfg .MaxDownloadThreads = 1
331- // HTTPClient is nil by default
334+ // Transport is nil by default
332335
333336 bi , err := NewCloudBatchIterator (
334337 context .Background (),
@@ -338,12 +341,12 @@ func TestCloudFetchIterator(t *testing.T) {
338341 )
339342 assert .Nil (t , err )
340343
341- // Verify nil client is passed through
344+ // Verify nil transport is passed through
342345 wrapper , ok := bi .(* batchIterator )
343346 assert .True (t , ok )
344347 cbi , ok := wrapper .ipcIterator .(* cloudIPCStreamIterator )
345348 assert .True (t , ok )
346- assert .Nil (t , cbi .httpClient )
349+ assert .Nil (t , cbi .transport )
347350
348351 // Fetch should work (falls back to http.DefaultClient)
349352 sab1 , nextErr := bi .Next ()
0 commit comments