Skip to content

Commit c9d2611

Browse files
committed
factor-outbound-http: Log more details for tests
Trying to debug a flaky CI test failure. Signed-off-by: Lann Martin <[email protected]>
1 parent b4dbbf5 commit c9d2611

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

crates/factor-outbound-http/src/wasi.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,12 @@ impl ConnectOptions {
378378

379379
let mut socket_addrs = tokio::net::lookup_host(host_and_port)
380380
.await
381-
.map_err(|_| dns_error("address not available".into(), 0))?
381+
.map_err(|err| {
382+
tracing::debug!(?host_and_port, ?err, "Error resolving host");
383+
dns_error("address not available".into(), 0)
384+
})?
382385
.collect::<Vec<_>>();
386+
tracing::debug!(?host_and_port, ?socket_addrs, "Resolved host");
383387

384388
// Remove blocked IPs
385389
let blocked_addrs = self.blocked_networks.remove_blocked(&mut socket_addrs);

crates/telemetry/src/testing.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
use tracing::level_filters::LevelFilter;
2+
use tracing_subscriber::fmt::format::FmtSpan;
3+
14
/// Initializes telemetry integration for libtest environments.
25
pub fn init_test_telemetry() {
36
static ONCE: std::sync::Once = std::sync::Once::new();
47
ONCE.call_once(|| {
5-
if let Err(err) = tracing_subscriber::fmt().with_test_writer().try_init() {
8+
if let Err(err) = tracing_subscriber::fmt()
9+
.with_max_level(LevelFilter::DEBUG)
10+
.with_span_events(FmtSpan::CLOSE)
11+
.with_test_writer()
12+
.try_init()
13+
{
614
eprintln!("init_test_telemetry failed to init global tracing_subscriber: {err:?}");
715
}
816
});

0 commit comments

Comments
 (0)