Skip to content

Commit

Permalink
Fix CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan committed Dec 18, 2024
1 parent 5c1fd73 commit 8e67614
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions opentelemetry-sdk/src/logs/log_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,9 @@ impl BatchLogProcessor {
);
}
Err(err) => {
// TODO: this should not happen! Log the error and continue for now.
otel_error!(
name: "BatchLogProcessor.ReceiveError",
name: "BatchLogProcessor.InternalError",
error = format!("{}", err)
);
}
Expand Down Expand Up @@ -417,6 +418,7 @@ impl BatchLogProcessor {
}
}

#[allow(clippy::vec_box)]
fn export_with_timeout_sync<E>(
_: Duration, // TODO, enforcing timeout in exporter.
exporter: &mut E,
Expand All @@ -440,7 +442,7 @@ where
let export_result = futures_executor::block_on(export);

match export_result {
Ok(__) => LogResult::Ok(()),
Ok(_) => LogResult::Ok(()),
Err(err) => {
otel_error!(
name: "BatchLogProcessor.ExportError",
Expand Down Expand Up @@ -717,6 +719,7 @@ where
/// Batch log processor configuration.
/// Use [`BatchConfigBuilder`] to configure your own instance of [`BatchConfig`].
#[derive(Debug)]
#[allow(dead_code)]
pub struct BatchConfig {
/// The maximum queue size to buffer logs for delayed processing. If the
/// queue gets full it drops the logs. The default value of is 2048.
Expand Down Expand Up @@ -1138,6 +1141,10 @@ mod tests {
.build(),
)
.build();

// wait for the batch processor to process the resource.
tokio::time::sleep(Duration::from_millis(100)).await;

assert_eq!(exporter.get_resource().unwrap().into_iter().count(), 5);
let _ = provider.shutdown();
}
Expand Down

0 comments on commit 8e67614

Please sign in to comment.