Skip to content

Commit 0c372cd

Browse files
test: Resolve Truffle ruby intermittent failures on exporters (#1752)
* test: Use Zlib.gunzip to compare body with estr Zlib.gzip adds a timestamp, which may be different than the one in the encoded req.body due to the test timing, and may cause an intermittent failure. Compare the unzipped request with the encoded_estr to avoid the timestamp interfering with the equality check. Co-authored-by: Tanna McClure <[email protected]> * test: Remove skip for TruffleRuby The assertions in this test differ from the other intermittent failures. Hopefully, the test is not failing and was skipped because the name of the test is the same as others. * chore: Remove comment --------- Co-authored-by: Tanna McClure <[email protected]>
1 parent 4c9f7e1 commit 0c372cd

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

exporter/otlp-common/test/opentelemetry/exporter/otlp/common/common_test.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
end
4242

4343
it 'translates all the things' do
44-
# TODO: See issue #1507 to fix
45-
skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby'
46-
4744
OpenTelemetry.tracer_provider = OpenTelemetry::SDK::Trace::TracerProvider.new(resource: OpenTelemetry::SDK::Resources::Resource.telemetry_sdk)
4845
tracer = OpenTelemetry.tracer_provider.tracer('tracer', 'v0.0.1')
4946
other_tracer = OpenTelemetry.tracer_provider.tracer('other_tracer')

exporter/otlp-http/test/opentelemetry/exporter/otlp/http/trace_exporter_test.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,6 @@
468468
end
469469

470470
it 'translates all the things' do
471-
# TODO: See issue #1507 to fix
472-
skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby'
473-
474471
stub_request(:post, 'http://localhost:4318/v1/traces').to_return(status: 200)
475472
processor = OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter)
476473
tracer = OpenTelemetry.tracer_provider.tracer('tracer', 'v0.0.1')
@@ -635,7 +632,7 @@
635632
)
636633

637634
assert_requested(:post, 'http://localhost:4318/v1/traces') do |req|
638-
req.body == Zlib.gzip(encoded_etsr)
635+
Zlib.gunzip(req.body) == encoded_etsr
639636
end
640637
end
641638
end

exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,6 @@
556556
end
557557

558558
it 'translates all the things' do
559-
skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby'
560-
561559
stub_request(:post, 'http://localhost:4318/v1/metrics').to_return(status: 200)
562560
meter_provider.add_metric_reader(exporter)
563561
meter = meter_provider.meter('test')
@@ -639,7 +637,7 @@
639637
)
640638

641639
assert_requested(:post, 'http://localhost:4318/v1/metrics') do |req|
642-
req.body == Zlib.gzip(encoded_etsr) # is asserting that the body of the HTTP request is equal to the result of gzipping the encoded_etsr.
640+
Zlib.gunzip(req.body) == encoded_etsr
643641
end
644642
end
645643
end

exporter/otlp/test/opentelemetry/exporter/otlp/exporter_test.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,6 @@
611611
end
612612

613613
it 'translates all the things' do
614-
# TODO: See issue #1507 to fix
615-
skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby'
616-
617614
stub_request(:post, 'http://localhost:4318/v1/traces').to_return(status: 200)
618615
processor = OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter)
619616
tracer = OpenTelemetry.tracer_provider.tracer('tracer', 'v0.0.1')
@@ -778,7 +775,7 @@
778775
)
779776

780777
assert_requested(:post, 'http://localhost:4318/v1/traces') do |req|
781-
req.body == Zlib.gzip(encoded_etsr)
778+
Zlib.gunzip(req.body) == encoded_etsr
782779
end
783780
end
784781
end

0 commit comments

Comments
 (0)