@@ -361,8 +361,10 @@ fn test_vortex_scan_over_http() {
361361 let listener = TcpListener :: bind ( "127.0.0.1:0" ) . unwrap ( ) ;
362362 let addr = listener. local_addr ( ) . unwrap ( ) ;
363363
364+ // Spawn 10 threads because DuckDB does HEAD and GET requests with retries,
365+ // thus 2 threads, one for each implementation, aren't enough
364366 std:: thread:: spawn ( move || {
365- for _ in 0 ..2 {
367+ for _ in 0 ..10 {
366368 if let Ok ( ( mut stream, _) ) = listener. accept ( ) {
367369 let response = format ! (
368370 "HTTP/1.1 200 OK\r \n Content-Length: {}\r \n \r \n " ,
@@ -376,24 +378,30 @@ fn test_vortex_scan_over_http() {
376378
377379 let conn = database_connection ( ) ;
378380 conn. query ( "SET vortex_filesystem = 'duckdb';" ) . unwrap ( ) ;
379- conn. query ( "INSTALL httpfs;" ) . unwrap ( ) ;
380- conn. query ( "LOAD httpfs;" ) . unwrap ( ) ;
381+ for httpfs_impl in [ "httplib" , "curl" ] {
382+ println ! ( "Testing httpfs client implementation: {httpfs_impl}" ) ;
383+ conn. query ( & format ! (
384+ "SET httpfs_client_implementation = '{httpfs_impl}';"
385+ ) )
386+ . unwrap ( ) ;
381387
382- let url = format ! (
383- "http://{}/{}" ,
384- addr,
385- file. path( ) . file_name( ) . unwrap( ) . to_string_lossy( )
386- ) ;
388+ let url = format ! (
389+ "http://{}/{}" ,
390+ addr,
391+ file. path( ) . file_name( ) . unwrap( ) . to_string_lossy( )
392+ ) ;
393+ println ! ( "url={url}, file={}" , file. path( ) . display( ) ) ;
387394
388- let result = conn
389- . query ( & format ! ( "SELECT COUNT(*) FROM read_vortex('{url}')" ) )
390- . unwrap ( ) ;
391- let chunk = result. into_iter ( ) . next ( ) . unwrap ( ) ;
392- let count = chunk
393- . get_vector ( 0 )
394- . as_slice_with_len :: < i64 > ( chunk. len ( ) . as_ ( ) ) [ 0 ] ;
395+ let result = conn
396+ . query ( & format ! ( "SELECT COUNT(*) FROM read_vortex('{url}')" ) )
397+ . unwrap ( ) ;
398+ let chunk = result. into_iter ( ) . next ( ) . unwrap ( ) ;
399+ let count = chunk
400+ . get_vector ( 0 )
401+ . as_slice_with_len :: < i64 > ( chunk. len ( ) . as_ ( ) ) [ 0 ] ;
395402
396- assert_eq ! ( count, 3 ) ;
403+ assert_eq ! ( count, 3 ) ;
404+ }
397405}
398406
399407#[ test]
0 commit comments