@@ -561,7 +561,7 @@ mod test {
561561 for _ in 0 ..steps {
562562 let gen_1 = otel_metrics1. generate( & mut rng1) ?;
563563 let gen_2 = otel_metrics2. generate( & mut rng2) ?;
564- debug_assert_eq !( gen_1, gen_2) ;
564+ prop_assert_eq !( gen_1, gen_2) ;
565565 }
566566 }
567567 }
@@ -577,7 +577,7 @@ mod test {
577577
578578 let mut bytes = Vec :: with_capacity( max_bytes) ;
579579 metrics. to_bytes( rng, max_bytes, & mut bytes) . expect( "failed to convert to bytes" ) ;
580- assert !( bytes. len( ) <= max_bytes, "max len: {max_bytes}, actual: {}" , bytes. len( ) ) ;
580+ prop_assert !( bytes. len( ) <= max_bytes, "max len: {max_bytes}, actual: {}" , bytes. len( ) ) ;
581581 }
582582 }
583583
@@ -622,7 +622,9 @@ mod test {
622622 let actual_contexts = ids. len( ) ;
623623 let below = total_contexts_min as usize <= actual_contexts;
624624 let above = actual_contexts <= total_contexts_max as usize ;
625- debug_assert!( below && above, "Inequality failed: {below} <= {actual_contexts} <= {above}" ) ;
625+ prop_assert!( below && above,
626+ "expected {} ≤ {} ≤ {}" ,
627+ total_contexts_min, actual_contexts, total_contexts_max) ;
626628 }
627629 }
628630
@@ -693,36 +695,36 @@ mod test {
693695 let metric = otel_metrics. generate( & mut rng) ?;
694696
695697 if let Some ( resource) = & metric. resource {
696- assert !(
698+ prop_assert !(
697699 resource. attributes. len( ) <= attributes_per_resource as usize ,
698700 "Resource attributes count {len} exceeds configured maximum {attributes_per_resource}" ,
699701 len = resource. attributes. len( ) ,
700702 ) ;
701703 }
702704
703- assert !(
705+ prop_assert !(
704706 metric. scope_metrics. len( ) <= scopes_per_resource as usize ,
705707 "Scopes per resource count {len} exceeds configured maximum {scopes_per_resource}" ,
706708 len = metric. scope_metrics. len( ) ,
707709 ) ;
708710
709711 for scope in & metric. scope_metrics {
710712 if let Some ( scope) = & scope. scope {
711- assert !(
713+ prop_assert !(
712714 scope. attributes. len( ) <= attributes_per_scope as usize ,
713715 "Scope attributes count {len} exceeds configured maximum {attributes_per_scope}" ,
714716 len = scope. attributes. len( ) ,
715717 ) ;
716718 }
717719
718- assert !(
720+ prop_assert !(
719721 scope. metrics. len( ) <= metrics_per_scope as usize ,
720722 "Metrics per scope count {len} exceeds configured maximum {metrics_per_scope}" ,
721723 len = scope. metrics. len( ) ,
722724 ) ;
723725
724726 for metric in & scope. metrics {
725- assert !(
727+ prop_assert !(
726728 metric. metadata. len( ) <= attributes_per_metric as usize ,
727729 "Metric attributes count {len} exceeds configured maximum {attributes_per_metric}" ,
728730 len = metric. metadata. len( ) ,
0 commit comments