Skip to content

Commit

Permalink
Be explicit about the DNS server used in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
romanb committed Jan 25, 2021
1 parent 5bd619e commit 37da8e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions transports/dns/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,19 +591,27 @@ mod tests {

#[cfg(feature = "async-std")]
{
// Be explicit about the resolver used. At least on github CI, TXT
// type record lookups may not work with the system DNS resolver.
let config = ResolverConfig::google();
let opts = ResolverOpts::default();
async_std_crate::task::block_on(
DnsConfig::system(CustomTransport).then(|dns| run(dns.unwrap()))
DnsConfig::custom(CustomTransport, config, opts).then(|dns| run(dns.unwrap()))
);
}

#[cfg(feature = "tokio")]
{
// Be explicit about the resolver used. At least on github CI, TXT
// type record lookups may not work with the system DNS resolver.
let config = ResolverConfig::quad9();
let opts = ResolverOpts::default();
let rt = tokio_crate::runtime::Builder::new_current_thread()
.enable_io()
.enable_time()
.build()
.unwrap();
rt.block_on(run(TokioDnsConfig::system(CustomTransport).unwrap()));
rt.block_on(run(TokioDnsConfig::custom(CustomTransport, config, opts).unwrap()));
}
}
}

0 comments on commit 37da8e0

Please sign in to comment.