@@ -687,7 +687,10 @@ mod tests {
687687 #[ test]
688688 fn get_path_for_block_key ( ) {
689689 let cache_dir = PathBuf :: from ( "mountpoint-cache/" ) ;
690- let pool = PagedPool :: new_with_candidate_sizes_unlimited ( [ 1024 ] ) ;
690+ let pool = PagedPool :: config ( )
691+ . with_candidate_sizes ( [ 1024 ] )
692+ . with_no_memory_limit ( )
693+ . build ( ) ;
691694 let data_cache = DiskDataCache :: new (
692695 DiskDataCacheConfig {
693696 cache_directory : cache_dir,
@@ -719,7 +722,10 @@ mod tests {
719722 #[ test]
720723 fn get_path_for_block_key_huge_block_index ( ) {
721724 let cache_dir = PathBuf :: from ( "mountpoint-cache/" ) ;
722- let pool = PagedPool :: new_with_candidate_sizes_unlimited ( [ 1024 ] ) ;
725+ let pool = PagedPool :: config ( )
726+ . with_candidate_sizes ( [ 1024 ] )
727+ . with_no_memory_limit ( )
728+ . build ( ) ;
723729 let data_cache = DiskDataCache :: new (
724730 DiskDataCacheConfig {
725731 cache_directory : cache_dir,
@@ -761,7 +767,10 @@ mod tests {
761767 let object_2_size = data_2. len ( ) ;
762768
763769 let cache_directory = tempfile:: tempdir ( ) . unwrap ( ) ;
764- let pool = PagedPool :: new_with_candidate_sizes_unlimited ( [ pool_buffer_size] ) ;
770+ let pool = PagedPool :: config ( )
771+ . with_candidate_sizes ( [ pool_buffer_size] )
772+ . with_no_memory_limit ( )
773+ . build ( ) ;
765774 let cache = DiskDataCache :: new (
766775 DiskDataCacheConfig {
767776 cache_directory : cache_directory. path ( ) . to_path_buf ( ) ,
@@ -848,7 +857,10 @@ mod tests {
848857 let slice = data. slice ( 1 ..5 ) ;
849858
850859 let cache_directory = tempfile:: tempdir ( ) . unwrap ( ) ;
851- let pool = PagedPool :: new_with_candidate_sizes_unlimited ( [ 8 * 1024 * 1024 ] ) ;
860+ let pool = PagedPool :: config ( )
861+ . with_candidate_sizes ( [ 8 * 1024 * 1024 ] )
862+ . with_no_memory_limit ( )
863+ . build ( ) ;
852864 let cache = DiskDataCache :: new (
853865 DiskDataCacheConfig {
854866 cache_directory : cache_directory. path ( ) . to_path_buf ( ) ,
@@ -930,7 +942,10 @@ mod tests {
930942 let small_object_key = ObjectId :: new ( "small" . into ( ) , ETag :: for_tests ( ) ) ;
931943
932944 let cache_directory = tempfile:: tempdir ( ) . unwrap ( ) ;
933- let pool = PagedPool :: new_with_candidate_sizes_unlimited ( [ BLOCK_SIZE ] ) ;
945+ let pool = PagedPool :: config ( )
946+ . with_candidate_sizes ( [ BLOCK_SIZE ] )
947+ . with_no_memory_limit ( )
948+ . build ( ) ;
934949 let cache = DiskDataCache :: new (
935950 DiskDataCacheConfig {
936951 cache_directory : cache_directory. path ( ) . to_path_buf ( ) ,
@@ -1113,7 +1128,10 @@ mod tests {
11131128 // "Corrupt" the serialized value with an invalid length.
11141129 replace_u64_at ( & mut buf, offset, u64:: MAX ) ;
11151130
1116- let pool = PagedPool :: new_with_candidate_sizes_unlimited ( [ MAX_LENGTH as usize ] ) ;
1131+ let pool = PagedPool :: config ( )
1132+ . with_candidate_sizes ( [ MAX_LENGTH as usize ] )
1133+ . with_no_memory_limit ( )
1134+ . build ( ) ;
11171135 let err =
11181136 DiskBlock :: read ( & mut Cursor :: new ( buf) , MAX_LENGTH , & pool, None ) . expect_err ( "deserialization should fail" ) ;
11191137 match length_to_corrupt {
@@ -1130,7 +1148,10 @@ mod tests {
11301148 fn test_concurrent_access ( ) {
11311149 let block_size = 1024 * 1024 ;
11321150 let cache_directory = tempfile:: tempdir ( ) . unwrap ( ) ;
1133- let pool = PagedPool :: new_with_candidate_sizes_unlimited ( [ block_size] ) ;
1151+ let pool = PagedPool :: config ( )
1152+ . with_candidate_sizes ( [ block_size] )
1153+ . with_no_memory_limit ( )
1154+ . build ( ) ;
11341155 let data_cache = DiskDataCache :: new (
11351156 DiskDataCacheConfig {
11361157 cache_directory : cache_directory. path ( ) . to_path_buf ( ) ,
0 commit comments