Skip to content

Commit 17676f6

Browse files
fix(test): transient failure in test_get_size_beacon_entry (#5931)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent c17dc8c commit 17676f6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/beacon/beacon_entries.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ pub struct BeaconEntry {
3333

3434
impl BeaconEntry {
3535
pub fn new(round: u64, signature: Vec<u8>) -> Self {
36+
// Drop any excess capacity to make heap usage deterministic across allocators.
37+
// Avoid shrink_to_fit: it's a non-binding hint.
38+
let signature = signature.into_boxed_slice().into_vec();
39+
debug_assert_eq!(
40+
signature.len(),
41+
signature.capacity(),
42+
"BeaconEntry::signature should be right-sized"
43+
);
3644
Self { round, signature }
3745
}
3846

0 commit comments

Comments
 (0)