Skip to content

Commit

Permalink
Remove test that is no longer valid
Browse files Browse the repository at this point in the history
Blockstore clips shreds that are too large now
  • Loading branch information
Steven Czabaniuk committed Apr 23, 2021
1 parent b685910 commit 28f7ad8
Showing 1 changed file with 0 additions and 61 deletions.
61 changes: 0 additions & 61 deletions core/src/serve_repair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -925,67 +925,6 @@ mod tests {
Blockstore::destroy(&ledger_path).expect("Expected successful database destruction");
}

#[test]
fn run_orphan_corrupted_shred_size() {
solana_logger::setup();
let recycler = PacketsRecycler::default();
let ledger_path = get_tmp_ledger_path!();
{
let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap());
// Create slots [1, 2] with 1 shred apiece
let (mut shreds, _) = make_many_slot_entries(1, 2, 1);

// Make shred for slot 1 too large
assert_eq!(shreds[0].slot(), 1);
assert_eq!(shreds[0].index(), 0);
shreds[0].payload.push(10);
shreds[0].data_header.size = shreds[0].payload.len() as u16;
blockstore
.insert_shreds(shreds, None, false)
.expect("Expect successful ledger write");
let nonce = 42;
// Make sure repair response is corrupted
assert!(repair_response::repair_response_packet(
&blockstore,
1,
0,
&socketaddr_any!(),
nonce,
)
.is_none());

// Orphan request for slot 2 should only return slot 1 since
// calling `repair_response_packet` on slot 1's shred will
// be corrupted
let rv: Vec<_> = ServeRepair::run_orphan(
&recycler,
&socketaddr_any!(),
Some(&blockstore),
2,
5,
nonce,
)
.expect("run_orphan packets")
.packets
.iter()
.cloned()
.collect();

// Verify responses
let expected = vec![repair_response::repair_response_packet(
&blockstore,
2,
0,
&socketaddr_any!(),
nonce,
)
.unwrap()];
assert_eq!(rv, expected);
}

Blockstore::destroy(&ledger_path).expect("Expected successful database destruction");
}

#[test]
fn test_repair_with_repair_validators() {
let cluster_slots = ClusterSlots::default();
Expand Down

0 comments on commit 28f7ad8

Please sign in to comment.