Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

courses/dss: fix clippy warning when running 'make test_others' #459

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion courses/dss/labrpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ pub mod tests {
pool.spawn_ok(async move {
let x = i + 100;
// this call ought to return false.
let _ = cli.handler2(&JunkArgs { x });
let _ = cli.handler2(&JunkArgs { x }).await;
sender.send(true).unwrap();
});
}
Expand Down
12 changes: 6 additions & 6 deletions courses/dss/raft/src/kvraft/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Config {
pub fn connect_all(&self) {
let servers = self.servers.lock().unwrap();
for i in 0..self.n {
self.connect(i, &self.all(), &*servers);
self.connect(i, &self.all(), &servers);
}
}

Expand All @@ -178,12 +178,12 @@ impl Config {
debug!("partition servers into: {:?} {:?}", p1, p2);
let servers = self.servers.lock().unwrap();
for i in p1 {
self.disconnect(*i, p2, &*servers);
self.connect(*i, p1, &*servers);
self.disconnect(*i, p2, &servers);
self.connect(*i, p1, &servers);
}
for i in p2 {
self.disconnect(*i, p1, &*servers);
self.connect(*i, p2, &*servers);
self.disconnect(*i, p1, &servers);
self.connect(*i, p2, &servers);
}
}

Expand Down Expand Up @@ -232,7 +232,7 @@ impl Config {
/// Shutdown a server by isolating it
pub fn shutdown_server(&self, i: usize) {
let mut servers = self.servers.lock().unwrap();
self.disconnect(i, &self.all(), &*servers);
self.disconnect(i, &self.all(), &servers);

// disable client connections to the server.
// it's important to do this before creating
Expand Down
2 changes: 1 addition & 1 deletion courses/dss/raft/src/raft/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ fn test_figure_8_unreliable_2c() {

if (random.gen::<usize>() % 1000) < 100 {
let ms = random.gen::<u64>() % (RAFT_ELECTION_TIMEOUT.as_millis() as u64 / 2);
thread::sleep(Duration::from_millis(ms as u64));
thread::sleep(Duration::from_millis(ms));
} else {
let ms = random.gen::<u64>() % 13;
thread::sleep(Duration::from_millis(ms));
Expand Down