You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
844
-
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 70.0 B remain available for the total memory pool: greedy(used: 30.0 B, pool_size: 100.0 B)
845
-
"));
846
-
847
-
// Test: unregister one
848
-
// only the remaining one should be listed
849
-
drop(r1);
850
-
let res = r0.try_grow(150);
851
-
assert!(res.is_err());
852
-
let error = res.unwrap_err().strip_backtrace();
853
-
allow_duplicates!(assert_snapshot!(error, @r"
854
-
Resources exhausted: Additional allocation failed for r0 with top memory consumers (across reservations) as:
855
-
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
856
-
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 90.0 B remain available for the total memory pool: fair(pool_size: 100.0 B)
857
-
"));
858
-
859
-
// Test: actual message we see is the `available is 70`. When it should be `available is 90`.
860
-
// This is because the pool.shrink() does not automatically occur within the inner_pool.deregister().
861
-
let res = r0.try_grow(150);
862
-
assert!(res.is_err());
863
-
let error = res.unwrap_err().strip_backtrace();
864
-
allow_duplicates!(assert_snapshot!(error, @r"
865
-
Resources exhausted: Additional allocation failed for r0 with top memory consumers (across reservations) as:
866
-
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
867
-
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 90.0 B remain available for the total memory pool: fair(pool_size: 100.0 B)
868
-
"));
869
-
870
-
// Test: the registration needs to free itself (or be dropped),
871
-
// for the proper error message
872
-
let res = r0.try_grow(150);
873
-
assert!(res.is_err());
874
-
let error = res.unwrap_err().strip_backtrace();
875
-
allow_duplicates!(assert_snapshot!(error, @r"
876
-
Resources exhausted: Additional allocation failed for r0 with top memory consumers (across reservations) as:
877
-
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
878
-
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 90.0 B remain available for the total memory pool: fair(pool_size: 100.0 B)
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
860
+
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 70.0 B remain available for the total memory pool: [INNER_POOL]
861
+
");
862
+
863
+
// Test: unregister one — only the remaining consumer should be listed
864
+
drop(r1);
865
+
let error = r0.try_grow(150).unwrap_err().strip_backtrace();
866
+
assert_snapshot!(error, @r"
867
+
Resources exhausted: Additional allocation failed for r0 with top memory consumers (across reservations) as:
868
+
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
869
+
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 90.0 B remain available for the total memory pool: [INNER_POOL]
870
+
");
871
+
872
+
// Test: actual message we see is the `available is 70`. When it should be `available is 90`.
873
+
// This is because the pool.shrink() does not automatically occur within the inner_pool.deregister().
874
+
let error = r0.try_grow(150).unwrap_err().strip_backtrace();
875
+
assert_snapshot!(error, @r"
876
+
Resources exhausted: Additional allocation failed for r0 with top memory consumers (across reservations) as:
877
+
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
878
+
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 90.0 B remain available for the total memory pool: [INNER_POOL]
879
+
");
880
+
881
+
// Test: the registration needs to free itself (or be dropped),
882
+
// for the proper error message
883
+
let error = r0.try_grow(150).unwrap_err().strip_backtrace();
884
+
assert_snapshot!(error, @r"
885
+
Resources exhausted: Additional allocation failed for r0 with top memory consumers (across reservations) as:
886
+
r0#[ID](can spill: false) consumed 10.0 B, peak 10.0 B.
887
+
Error: Failed to allocate additional 150.0 B for r0 with 10.0 B already allocated for this reservation - 90.0 B remain available for the total memory pool: [INNER_POOL]
888
+
");
889
+
}
890
+
);
880
891
}
881
892
882
-
let tracked_spill_pool:Arc<dynMemoryPool> = Arc::new(TrackConsumersPool::new(
883
-
FairSpillPool::new(100),
884
-
NonZeroUsize::new(3).unwrap(),
885
-
));
886
-
test_per_pool_type(tracked_spill_pool);
893
+
allow_duplicates!{
894
+
let tracked_spill_pool = Arc::new(TrackConsumersPool::new(
895
+
FairSpillPool::new(100),
896
+
NonZeroUsize::new(3).unwrap(),
897
+
));
898
+
test_per_pool_type(tracked_spill_pool);
887
899
888
-
let tracked_greedy_pool:Arc<dynMemoryPool> = Arc::new(TrackConsumersPool::new(
889
-
GreedyMemoryPool::new(100),
890
-
NonZeroUsize::new(3).unwrap(),
891
-
));
892
-
test_per_pool_type(tracked_greedy_pool);
900
+
let tracked_greedy_pool = Arc::new(TrackConsumersPool::new(
0 commit comments