| 1234567891011121314151617181920212223242526272829303132333435 |
- extern crate ruaft;
- mod config;
- #[test]
- fn initial_election() -> std::io::Result<()> {
- const SERVERS: usize = 3;
- let cfg = config::make_config(SERVERS, false);
- let guard = ruaft::utils::DropGuard::new(|| cfg.cleanup());
- cfg.begin("Test (2A): initial election");
- cfg.check_one_leader()?;
- config::sleep_millis(50);
- let first_term = cfg.check_terms()?;
- config::sleep_election_timeouts(2);
- let second_term = cfg.check_terms()?;
- if first_term != second_term {
- eprintln!("Warning: term change even though there were no failures");
- }
- cfg.check_one_leader()?;
- cfg.end();
- drop(guard);
- Ok(())
- }
- #[test]
- fn re_election() {}
|