Skip to content

Commit 8d5d510

Browse files
committed
fix windows and miri problems
1 parent bc55596 commit 8d5d510

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

libdd-profiling/src/exporter/file_exporter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub(crate) fn spawn_dump_server(output_path: PathBuf) -> anyhow::Result<PathBuf>
8080
async fn run_dump_server_windows(
8181
output_path: PathBuf,
8282
pipe_name: String,
83-
mut first_server: tokio::net::windows::named_pipe::NamedPipeServer,
83+
first_server: tokio::net::windows::named_pipe::NamedPipeServer,
8484
) -> anyhow::Result<()> {
8585
use tokio::net::windows::named_pipe::ServerOptions;
8686

@@ -119,7 +119,7 @@ pub(crate) fn spawn_dump_server(output_path: PathBuf) -> anyhow::Result<PathBuf>
119119
let pipe_path = PathBuf::from(&pipe_name);
120120

121121
let (tx, rx) = std::sync::mpsc::channel();
122-
122+
123123
std::thread::spawn(move || {
124124
// Top-level error handler - all errors logged here
125125
let result = (|| -> anyhow::Result<()> {
@@ -129,12 +129,12 @@ pub(crate) fn spawn_dump_server(output_path: PathBuf) -> anyhow::Result<PathBuf>
129129
let first_server = ServerOptions::new()
130130
.first_pipe_instance(true)
131131
.create(&pipe_name)?;
132-
132+
133133
tx.send(Ok(()))?;
134134
run_dump_server_windows(output_path, pipe_name, first_server).await
135135
})
136136
})();
137-
137+
138138
if let Err(e) = result {
139139
eprintln!("[dump-server] Error: {}", e);
140140
let _ = tx.send(Err(e));

libdd-profiling/src/exporter/profile_exporter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl ProfileExporter {
8686
let output_path = libdd_common::decode_uri_path_in_authority(&endpoint.url)
8787
.context("Failed to decode file path from URI")?;
8888
let pipe_path = spawn_dump_server(output_path)?;
89-
builder = builder.windows_named_pipe(pipe_path);
89+
builder = builder.windows_named_pipe(pipe_path.to_string_lossy().to_string());
9090
"http://localhost/v1/input".to_string()
9191
}
9292

@@ -108,7 +108,7 @@ impl ProfileExporter {
108108
Some("windows") => {
109109
use libdd_common::connector::named_pipe::named_pipe_path_from_uri;
110110
let pipe_path = named_pipe_path_from_uri(&endpoint.url)?;
111-
builder = builder.windows_named_pipe(pipe_path);
111+
builder = builder.windows_named_pipe(pipe_path.to_string_lossy().to_string());
112112
format!("http://localhost{}", endpoint.url.path())
113113
}
114114
#[cfg(unix)]

libdd-profiling/tests/exporter_e2e.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,40 +481,47 @@ async fn test_agentless_with_transport(transport: Transport) -> anyhow::Result<(
481481
}
482482

483483
#[tokio::test]
484+
#[cfg_attr(miri, ignore)]
484485
async fn test_export_agent_tcp() -> anyhow::Result<()> {
485486
test_agent_with_transport(Transport::Tcp).await
486487
}
487488

488489
#[cfg(unix)]
489490
#[tokio::test]
491+
#[cfg_attr(miri, ignore)]
490492
async fn test_export_agent_uds() -> anyhow::Result<()> {
491493
test_agent_with_transport(Transport::UnixSocket).await
492494
}
493495

494496
#[tokio::test]
497+
#[cfg_attr(miri, ignore)]
495498
async fn test_export_agentless_tcp() -> anyhow::Result<()> {
496499
test_agentless_with_transport(Transport::Tcp).await
497500
}
498501

499502
#[cfg(unix)]
500503
#[tokio::test]
504+
#[cfg_attr(miri, ignore)]
501505
async fn test_export_agentless_uds() -> anyhow::Result<()> {
502506
test_agentless_with_transport(Transport::UnixSocket).await
503507
}
504508

505509
#[cfg(windows)]
506510
#[tokio::test]
511+
#[cfg_attr(miri, ignore)]
507512
async fn test_export_agent_named_pipe() -> anyhow::Result<()> {
508513
test_agent_with_transport(Transport::NamedPipe).await
509514
}
510515

511516
#[cfg(windows)]
512517
#[tokio::test]
518+
#[cfg_attr(miri, ignore)]
513519
async fn test_export_agentless_named_pipe() -> anyhow::Result<()> {
514520
test_agentless_with_transport(Transport::NamedPipe).await
515521
}
516522

517523
#[tokio::test]
524+
#[cfg_attr(miri, ignore)]
518525
async fn test_export_file() -> anyhow::Result<()> {
519526
let file_path = create_temp_file_path("http");
520527
let endpoint = config::file(file_path.to_string_lossy().as_ref())?;

0 commit comments

Comments
 (0)