From 90a4ab7e57747ba4cec48cbba5274b5c18b8d509 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Mon, 9 Jul 2018 13:58:55 -0700 Subject: [PATCH] fixes issue #299 --- tests/multinode.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/multinode.rs b/tests/multinode.rs index e78f832707855e..46de1166b1465b 100644 --- a/tests/multinode.rs +++ b/tests/multinode.rs @@ -314,6 +314,9 @@ fn restart_leader( #[test] fn test_leader_restart_validator_start_from_old_ledger() { + // this test verifies that a freshly started leader makes his ledger available + // in the repair window to validators that are started with an older + // ledger (currently up to WINDOW_SIZE entries) logger::setup(); let (alice, ledger_path) = genesis(100_000); @@ -330,7 +333,7 @@ fn test_leader_restart_validator_start_from_old_ledger() { let mut stale_ledger_path = ledger_path.clone(); stale_ledger_path.insert_str(ledger_path.rfind("/").unwrap() + 1, "stale_"); - std::fs::copy(ledger_path.clone(), stale_ledger_path.clone()) + std::fs::copy(&ledger_path, &stale_ledger_path) .expect(format!("copy {} to {}", &ledger_path, &stale_ledger_path,).as_str()); // restart the leader @@ -366,7 +369,7 @@ fn test_leader_restart_validator_start_from_old_ledger() { let mut client = mk_client(&validator_data); let getbal = retry_get_balance(&mut client, &bob_pubkey, Some(leader_balance)); - assert!(getbal == Some(leader_balance)); + assert_eq!(getbal, Some(leader_balance)); exit.store(true, Ordering::Relaxed); leader_fullnode.join().unwrap();