Skip to content

Commit

Permalink
GH-525: fix the poll()
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshg6 committed Oct 8, 2024
1 parent 8658aed commit 37e193e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions node/src/server_initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,16 @@ impl Future for ServerInitializerReal {
type Error = ();

fn poll(&mut self) -> Result<Async<<Self as Future>::Item>, <Self as Future>::Error> {
// try_ready!(self
// .dns_socket_server
// .as_mut()
// .join(self.bootstrapper.as_mut())
// .poll());
try_ready!(self.bootstrapper.as_mut().poll());
match self.is_entry_dns_enabled {
true => {
try_ready!(self
.dns_socket_server
.as_mut()
.join(self.bootstrapper.as_mut())
.poll());
}
false => try_ready!(self.bootstrapper.as_mut().poll()),
}
Ok(Async::Ready(()))
}
}
Expand Down Expand Up @@ -798,8 +802,7 @@ pub mod tests {
}

#[test]
// TODO: GH-525: It should panic
// #[should_panic(expected = "EntryDnsServerMock was instructed to panic")]
#[should_panic(expected = "EntryDnsServerMock was instructed to panic")]
fn server_initializer_dns_socket_server_panics() {
let bootstrapper = CrashTestDummy::new(CrashPoint::None, BootstrapperConfig::new());
let privilege_dropper = PrivilegeDropperMock::new();
Expand All @@ -813,7 +816,7 @@ pub mod tests {
bootstrapper: Box::new(bootstrapper),
privilege_dropper: Box::new(privilege_dropper),
dirs_wrapper: Box::new(dirs_wrapper),
is_entry_dns_enabled: false,
is_entry_dns_enabled: true,
};

let _ = subject.poll();
Expand Down

0 comments on commit 37e193e

Please sign in to comment.