Skip to content

Commit cffe040

Browse files
committed
wip: otel flaky test
Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
1 parent 560df65 commit cffe040

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

tests/data/otel-collector-config.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ exporters:
1717
path: /tmp/metrics.json
1818
file/traces:
1919
path: /tmp/traces.json
20+
debug:
21+
verbosity: detailed
2022

2123
service:
2224
pipelines:
2325
metrics:
2426
receivers: [otlp]
2527
processors: []
26-
exporters: [file/metrics]
28+
exporters: [file/metrics, debug]
2729
traces:
2830
receivers: [otlp]
2931
processors: []
30-
exporters: [file/traces]
32+
exporters: [file/traces, debug]

tests/integration_test.rs

+16-5
Original file line numberDiff line numberDiff line change
@@ -955,11 +955,22 @@ async fn test_otel() {
955955
.with_max_delay(Duration::from_secs(30))
956956
.with_max_times(5);
957957

958-
let metrics_output_json =
959-
(|| async { parse_exporter_output(metrics_output_file.as_file()).await })
960-
.retry(exponential_backoff)
961-
.await
962-
.unwrap();
958+
let metrics_output_json = (|| async {
959+
let out = otelc.stdout_to_vec().await.unwrap();
960+
println!(
961+
"stdout: {}",
962+
String::from_utf8(out).unwrap_or("cannot get stdout".to_string())
963+
);
964+
let out = otelc.stderr_to_vec().await.unwrap();
965+
println!(
966+
"stderr: {}",
967+
String::from_utf8(out).unwrap_or("cannot get stderr".to_string())
968+
);
969+
parse_exporter_output(metrics_output_file.as_file()).await
970+
})
971+
.retry(exponential_backoff)
972+
.await
973+
.unwrap();
963974
let metrics = &metrics_output_json["resourceMetrics"][0]["scopeMetrics"][0];
964975
assert_eq!(metrics["scope"]["name"], "kubewarden");
965976
assert!(

0 commit comments

Comments
 (0)