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

enable DEBUG logging for a failed test in CI #229

Merged
merged 11 commits into from
Jun 18, 2024
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ jobs:
run: cargo build
- name: Run clippy and fail if any warnings
run: cargo clippy -- -D warnings
- name: Run tests
- name: Run tests with debugs
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-latest'
run: RUST_LOG=debug cargo test
- name: Run tests on Windows
if: matrix.os == 'windows-latest'
run: cargo test
2 changes: 1 addition & 1 deletion src/dns_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ impl DnsIncoming {
}

if let Some(record) = rec {
debug!("{:?}", &record);
debug!("read_others: {:?}", &record);
self.answers.push(record);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/service_daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ impl Zeroconf {
if info.is_ready() {
resolved.insert(ptr.alias.clone());
match sender.send(ServiceEvent::ServiceResolved(info)) {
Ok(()) => debug!("sent service resolved"),
Ok(()) => debug!("sent service resolved: {}", &ptr.alias),
Err(e) => error!("failed to send service resolved: {}", e),
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions tests/mdns_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::collections::{HashMap, HashSet};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::thread::sleep;
use std::time::{Duration, SystemTime};
use test_log::test;
// use test_log::test; // commented out for debugging a flaky test in CI.

/// This test covers:
/// register(announce), browse(query), response, unregister, shutdown.
Expand Down Expand Up @@ -1130,7 +1130,7 @@ fn hostname_resolution_timeout() {
d.shutdown().unwrap();
}

#[test]
#[test_log::test]
fn test_cache_flush_record() {
// Create a daemon
let server = ServiceDaemon::new().expect("Failed to create server");
Expand Down