1212
1313#![ allow( clippy:: disallowed_methods) ] // plain reqwest::Client is fine against local mock server
1414
15- use datadog_log_agent:: {
16- AggregatorService , FlusherMode , LogEntry , LogFlusher , LogFlusherConfig ,
17- } ;
15+ use datadog_log_agent:: { AggregatorService , FlusherMode , LogEntry , LogFlusher , LogFlusherConfig } ;
1816use mockito:: { Matcher , Server } ;
1917use std:: time:: Duration ;
2018
@@ -254,7 +252,11 @@ async fn test_max_entries_fits_in_one_batch() {
254252 handle. insert_batch ( entries) . expect ( "insert" ) ;
255253
256254 let batches = handle. get_batches ( ) . await . expect ( "get_batches" ) ;
257- assert_eq ! ( batches. len( ) , 1 , "exactly MAX_BATCH_ENTRIES fits in one batch" ) ;
255+ assert_eq ! (
256+ batches. len( ) ,
257+ 1 ,
258+ "exactly MAX_BATCH_ENTRIES fits in one batch"
259+ ) ;
258260
259261 let arr: serde_json:: Value = serde_json:: from_slice ( & batches[ 0 ] ) . expect ( "valid JSON" ) ;
260262 assert_eq ! ( arr. as_array( ) . unwrap( ) . len( ) , MAX ) ;
@@ -442,7 +444,9 @@ async fn test_opw_mode_disables_compression_regardless_of_config() {
442444
443445 let ( svc, handle) = AggregatorService :: new ( ) ;
444446 let _task = tokio:: spawn ( svc. run ( ) ) ;
445- handle. insert_batch ( vec ! [ entry( "not compressed in OPW" ) ] ) . expect ( "insert" ) ;
447+ handle
448+ . insert_batch ( vec ! [ entry( "not compressed in OPW" ) ] )
449+ . expect ( "insert" ) ;
446450
447451 // use_compression: true — but OPW mode overrides this to false
448452 let config = LogFlusherConfig {
@@ -457,7 +461,9 @@ async fn test_opw_mode_disables_compression_regardless_of_config() {
457461 flush_timeout : Duration :: from_secs ( 5 ) ,
458462 } ;
459463
460- let result = LogFlusher :: new ( config, build_client ( ) , handle) . flush ( ) . await ;
464+ let result = LogFlusher :: new ( config, build_client ( ) , handle)
465+ . flush ( )
466+ . await ;
461467
462468 assert ! ( result) ;
463469 mock. assert_async ( ) . await ;
@@ -485,7 +491,9 @@ async fn test_retry_on_500_succeeds_on_second_attempt() {
485491
486492 let ( svc, handle) = AggregatorService :: new ( ) ;
487493 let _task = tokio:: spawn ( svc. run ( ) ) ;
488- handle. insert_batch ( vec ! [ entry( "retry me" ) ] ) . expect ( "insert" ) ;
494+ handle
495+ . insert_batch ( vec ! [ entry( "retry me" ) ] )
496+ . expect ( "insert" ) ;
489497
490498 let result = LogFlusher :: new ( opw_config ( & server. url ( ) ) , build_client ( ) , handle)
491499 . flush ( )
@@ -507,7 +515,9 @@ async fn test_permanent_error_on_403_no_retry() {
507515
508516 let ( svc, handle) = AggregatorService :: new ( ) ;
509517 let _task = tokio:: spawn ( svc. run ( ) ) ;
510- handle. insert_batch ( vec ! [ entry( "forbidden" ) ] ) . expect ( "insert" ) ;
518+ handle
519+ . insert_batch ( vec ! [ entry( "forbidden" ) ] )
520+ . expect ( "insert" ) ;
511521
512522 let result = LogFlusher :: new ( opw_config ( & server. url ( ) ) , build_client ( ) , handle)
513523 . flush ( )
@@ -530,7 +540,9 @@ async fn test_exhausted_retries_returns_false() {
530540
531541 let ( svc, handle) = AggregatorService :: new ( ) ;
532542 let _task = tokio:: spawn ( svc. run ( ) ) ;
533- handle. insert_batch ( vec ! [ entry( "keep failing" ) ] ) . expect ( "insert" ) ;
543+ handle
544+ . insert_batch ( vec ! [ entry( "keep failing" ) ] )
545+ . expect ( "insert" ) ;
534546
535547 let result = LogFlusher :: new ( opw_config ( & server. url ( ) ) , build_client ( ) , handle)
536548 . flush ( )
@@ -564,7 +576,9 @@ async fn test_additional_endpoints_receive_same_batch() {
564576
565577 let ( svc, handle) = AggregatorService :: new ( ) ;
566578 let _task = tokio:: spawn ( svc. run ( ) ) ;
567- handle. insert_batch ( vec ! [ entry( "multi-endpoint" ) ] ) . expect ( "insert" ) ;
579+ handle
580+ . insert_batch ( vec ! [ entry( "multi-endpoint" ) ] )
581+ . expect ( "insert" ) ;
568582
569583 let config = LogFlusherConfig {
570584 api_key : "test-api-key" . to_string ( ) ,
@@ -578,7 +592,9 @@ async fn test_additional_endpoints_receive_same_batch() {
578592 flush_timeout : Duration :: from_secs ( 5 ) ,
579593 } ;
580594
581- let result = LogFlusher :: new ( config, build_client ( ) , handle) . flush ( ) . await ;
595+ let result = LogFlusher :: new ( config, build_client ( ) , handle)
596+ . flush ( )
597+ . await ;
582598
583599 assert ! ( result) ;
584600 primary_mock. assert_async ( ) . await ;
@@ -620,7 +636,9 @@ async fn test_additional_endpoint_failure_does_not_affect_return_value() {
620636 flush_timeout : Duration :: from_secs ( 5 ) ,
621637 } ;
622638
623- let result = LogFlusher :: new ( config, build_client ( ) , handle) . flush ( ) . await ;
639+ let result = LogFlusher :: new ( config, build_client ( ) , handle)
640+ . flush ( )
641+ . await ;
624642
625643 assert ! (
626644 result,
0 commit comments