Skip to content

Commit

Permalink
Nit fix to LogProcessor tests (#2467)
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Dec 24, 2024
1 parent 8d5f222 commit 6e1032f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions opentelemetry-otlp/tests/integration_test/tests/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ mod logtests {

tokio::time::sleep(Duration::from_secs(10)).await;

assert_logs_results(test_utils::LOGS_FILE, "expected/logs.json");
assert_logs_results(test_utils::LOGS_FILE, "expected/logs.json")?;

Ok(())
}
Expand Down Expand Up @@ -122,7 +122,7 @@ mod logtests {
}
let _ = logger_provider.shutdown();
// tokio::time::sleep(Duration::from_secs(10)).await;
assert_logs_results(test_utils::LOGS_FILE, "expected/logs.json");
assert_logs_results(test_utils::LOGS_FILE, "expected/logs.json")?;

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/tests/integration_test/tests/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use anyhow::Result;
use ctor::dtor;
use integration_test_runner::test_utils;
use opentelemetry_proto::tonic::trace::v1::TracesData;
use opentelemetry_sdk::{runtime, trace as sdktrace, Resource};
use opentelemetry_sdk::{trace as sdktrace, Resource};
use std::fs::File;
use std::io::Write;
use std::os::unix::fs::MetadataExt;
Expand Down
9 changes: 3 additions & 6 deletions opentelemetry-sdk/src/logs/log_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,11 @@ impl<T: LogExporter> LogProcessor for SimpleLogProcessor<T> {
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
enum BatchMessage {
/// Export logs, usually called when the log is emitted.
/// Export logs, called when the log is emitted.
ExportLog(Box<(LogRecord, InstrumentationScope)>),
/// Flush the current buffer to the backend, it can be triggered by
/// pre configured interval or a call to `force_push` function.
// Flush(Option<oneshot::Sender<ExportResult>>),
/// ForceFlush flushes the current buffer to the backend.
/// ForceFlush flushes the current buffer to the exporter.
ForceFlush(mpsc::SyncSender<ExportResult>),
/// Shut down the worker thread, push all logs in buffer to the backend.
/// Shut down the worker thread, push all logs in buffer to the exporter.
Shutdown(mpsc::SyncSender<ExportResult>),
/// Set the resource for the exporter.
SetResource(Arc<Resource>),
Expand Down

0 comments on commit 6e1032f

Please sign in to comment.