Skip to content

Commit 620ae38

Browse files
committed
fix tests
1 parent a9868b0 commit 620ae38

File tree

2 files changed

+8
-5
lines changed
  • opentelemetry-otlp/src/exporter/http
  • opentelemetry-proto/src/transform

2 files changed

+8
-5
lines changed

opentelemetry-otlp/src/exporter/http/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,7 @@ mod tests {
12551255
use super::super::OtlpHttpClient;
12561256
use opentelemetry_http::{Bytes, HttpClient};
12571257
use std::collections::HashMap;
1258+
use std::sync::Arc;
12581259

12591260
#[derive(Debug)]
12601261
struct MockHttpClient;
@@ -1317,7 +1318,7 @@ mod tests {
13171318
events: SpanEvents::default(),
13181319
links: SpanLinks::default(),
13191320
status: Status::Unset,
1320-
instrumentation_scope: opentelemetry::InstrumentationScope::default(),
1321+
instrumentation_scope: Arc::new(opentelemetry::InstrumentationScope::default()),
13211322
}
13221323
}
13231324

opentelemetry-proto/src/transform/trace.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ mod span_flags_tests {
223223
use opentelemetry::InstrumentationScope;
224224
use opentelemetry_sdk::trace::SpanData;
225225
use std::borrow::Cow;
226+
use std::sync::Arc;
226227

227228
#[test]
228229
fn test_build_span_flags_local_parent() {
@@ -272,7 +273,7 @@ mod span_flags_tests {
272273
events: opentelemetry_sdk::trace::SpanEvents::default(),
273274
links: opentelemetry_sdk::trace::SpanLinks::default(),
274275
status: opentelemetry::trace::Status::Unset,
275-
instrumentation_scope: InstrumentationScope::builder("test").build(),
276+
instrumentation_scope: Arc::new(InstrumentationScope::builder("test").build()),
276277
};
277278

278279
let otlp_span: Span = span_data.into();
@@ -300,7 +301,7 @@ mod span_flags_tests {
300301
events: opentelemetry_sdk::trace::SpanEvents::default(),
301302
links: opentelemetry_sdk::trace::SpanLinks::default(),
302303
status: opentelemetry::trace::Status::Unset,
303-
instrumentation_scope: InstrumentationScope::builder("test").build(),
304+
instrumentation_scope: Arc::new(InstrumentationScope::builder("test").build()),
304305
};
305306

306307
let otlp_span: Span = span_data.into();
@@ -325,6 +326,7 @@ mod tests {
325326
use opentelemetry_sdk::trace::SpanData;
326327
use opentelemetry_sdk::trace::{SpanEvents, SpanLinks};
327328
use std::borrow::Cow;
329+
use std::sync::Arc;
328330
use std::time::Duration;
329331

330332
fn create_test_span_data(instrumentation_name: &'static str) -> SpanData {
@@ -349,7 +351,7 @@ mod tests {
349351
events: SpanEvents::default(),
350352
links: SpanLinks::default(),
351353
status: Status::Unset,
352-
instrumentation_scope: InstrumentationScope::builder(instrumentation_name).build(),
354+
instrumentation_scope: Arc::new(InstrumentationScope::builder(instrumentation_name).build()),
353355
}
354356
}
355357

@@ -503,7 +505,7 @@ mod tests {
503505
events: SpanEvents::default(),
504506
links: SpanLinks::default(),
505507
status: Status::Unset,
506-
instrumentation_scope,
508+
instrumentation_scope: Arc::new(instrumentation_scope),
507509
};
508510

509511
let resource: ResourceAttributesWithSchema = (&resource).into();

0 commit comments

Comments
 (0)