Skip to content

Commit e3f166c

Browse files
committed
Merge branch 'master', remote-tracking branches 'u/flaky-di-test', 'u/telemetry-inject-deps' and 'u/telemetry-limit' into base
* master: Remove ethon thread helper in test suite (#5057) [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/19513184798 (#5068) * u/flaky-di-test: [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/19513184798 (#5068) DI: make a test method longer to avoid flakiness * u/telemetry-inject-deps: Update lib/datadog/profiling/profiler.rb Update lib/datadog/profiling/profiler.rb * u/telemetry-limit: [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/19513184798 (#5068)
5 parents 1504648 + 77aa204 + da3bf7c + adb655a + 31b17b0 commit e3f166c

File tree

9 files changed

+22
-44
lines changed

9 files changed

+22
-44
lines changed

.github/workflows/system-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
test:
7878
needs:
7979
- build
80-
uses: DataDog/system-tests/.github/workflows/system-tests.yml@7cc82692d3d02b17f20d6d0fcbee09de21f27ad4 # Automated: This reference is automatically updated.
80+
uses: DataDog/system-tests/.github/workflows/system-tests.yml@2eb26336ed43c2db1b7f90fff17ce4f5fc36a12b # Automated: This reference is automatically updated.
8181
secrets:
8282
TEST_OPTIMIZATION_API_KEY: ${{ secrets.DD_API_KEY }} # key used to pushed test results to test optim
8383
DD_API_KEY: ${{ secrets.DD_API_KEY }} # key used in tests runs
@@ -91,7 +91,7 @@ jobs:
9191
desired_execution_time: 300 # 5 minutes
9292
scenarios_groups: tracer_release
9393
skip_empty_scenarios: true
94-
ref: 7cc82692d3d02b17f20d6d0fcbee09de21f27ad4 # Automated: This reference is automatically updated.
94+
ref: 2eb26336ed43c2db1b7f90fff17ce4f5fc36a12b # Automated: This reference is automatically updated.
9595
force_execute: ${{ needs.build.outputs.forced_tests }}
9696
parametric_job_count: 8
9797
push_to_test_optimization: true

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ requirements_json_test:
146146

147147
configure_system_tests:
148148
variables:
149-
SYSTEM_TESTS_REF: 7cc82692d3d02b17f20d6d0fcbee09de21f27ad4 # Automated: This reference is automatically updated.
149+
SYSTEM_TESTS_REF: 2eb26336ed43c2db1b7f90fff17ce4f5fc36a12b # Automated: This reference is automatically updated.
150150
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,lib-injection"
151151

152152
save_versions:

lib/datadog/profiling/profiler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def initialize(worker:, scheduler:)
1818
end
1919

2020
def enabled?
21-
!!scheduler&.running?
21+
scheduler.running?
2222
end
2323

2424
def start

spec/datadog/di/integration/instrumentation_spec.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ def test_method(a = 1)
2020
42
2121
end
2222

23+
def long_test_method
24+
# This method is used to assert on @duration, and +test_method+
25+
# somehow managed to report an execution time of 0.0 in CI one time
26+
# (though normally it takes about 1 microsecond).
27+
Object.methods.length > 0 and 42
28+
end
29+
2330
def mutating_method(greeting)
2431
greeting.sub!('hello', 'bye')
2532
end
@@ -506,7 +513,7 @@ def run_test
506513
{
507514
id: '1234',
508515
type: 'LOG_PROBE',
509-
where: {typeName: 'InstrumentationSpecTestClass', methodName: 'test_method'},
516+
where: {typeName: 'InstrumentationSpecTestClass', methodName: 'long_test_method'},
510517
segments: segments,
511518
}
512519
end
@@ -535,7 +542,7 @@ def run_test
535542
expect(value).to be > 0
536543
expect(value).to be < 1
537544
end
538-
expect(InstrumentationSpecTestClass.new.test_method).to eq(42)
545+
expect(InstrumentationSpecTestClass.new.long_test_method).to eq(42)
539546
component.probe_notifier_worker.flush
540547
end
541548
end

spec/datadog/tracing/contrib/ethon/easy_patch_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
require 'datadog/tracing/contrib/ethon/shared_examples'
77
require 'datadog/tracing/contrib/analytics_examples'
88

9-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
10-
119
RSpec.describe Datadog::Tracing::Contrib::Ethon::EasyPatch do
1210
let(:configuration_options) { {} }
13-
let(:easy) { EthonSupport.ethon_easy_new }
11+
let(:easy) { Ethon::Easy.new }
1412
let(:server_error_statuses) { nil }
1513

1614
before do
@@ -252,7 +250,7 @@
252250

253251
context 'when basic auth in url' do
254252
it 'does not collect auth info' do
255-
easy = EthonSupport.ethon_easy_new(url: 'http://username:[email protected]/sample/path')
253+
easy = Ethon::Easy.new(url: 'http://username:[email protected]/sample/path')
256254

257255
easy.perform
258256

@@ -263,7 +261,7 @@
263261

264262
context 'when query string in url' do
265263
it 'does not collect query string' do
266-
easy = EthonSupport.ethon_easy_new(url: 'http://example.com/sample/path?foo=bar')
264+
easy = Ethon::Easy.new(url: 'http://example.com/sample/path?foo=bar')
267265

268266
easy.perform
269267

spec/datadog/tracing/contrib/ethon/integration_test_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
require 'datadog/tracing/contrib/support/spec_helper'
1010
require 'datadog/tracing/contrib/support/http'
1111

12-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
13-
1412
RSpec.describe 'Ethon integration tests' do
1513
skip_unless_integration_testing_enabled
1614

1715
context 'with Easy HTTP request' do
1816
subject(:request) do
19-
easy = EthonSupport.ethon_easy_new
17+
easy = Ethon::Easy.new
2018
easy.http_request(url, 'GET', params: query, timeout_ms: timeout * 1000)
2119
easy.perform
2220
# Use Typhoeus response wrapper to simplify tests
@@ -67,7 +65,7 @@
6765

6866
context 'with simple Easy & headers override' do
6967
subject(:request) do
70-
easy = EthonSupport.ethon_easy_new(url: url)
68+
easy = Ethon::Easy.new(url: url)
7169
easy.customrequest = 'GET'
7270
easy.set_attributes(timeout_ms: timeout * 1000)
7371
easy.headers = request_headers
@@ -104,7 +102,7 @@
104102
context 'with single Multi request' do
105103
subject(:request) do
106104
multi = Ethon::Multi.new
107-
easy = EthonSupport.ethon_easy_new
105+
easy = Ethon::Easy.new
108106
easy.http_request(url, 'GET', params: query, timeout_ms: timeout * 1000)
109107
multi.add(easy)
110108
multi.perform

spec/datadog/tracing/contrib/ethon/multi_patch_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
require 'datadog/tracing/contrib/environment_service_name_examples'
88
require 'datadog/tracing/contrib/span_attribute_schema_examples'
99

10-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
11-
1210
RSpec.describe Datadog::Tracing::Contrib::Ethon::MultiPatch do
1311
let(:configuration_options) { {} }
1412

@@ -26,7 +24,7 @@
2624
end
2725

2826
describe '#add' do
29-
let(:easy) { EthonSupport.ethon_easy_new }
27+
let(:easy) { Ethon::Easy.new }
3028
let(:span) { easy.instance_eval { @datadog_span } }
3129
let(:multi_span) { multi.instance_eval { @datadog_multi_span } }
3230
let(:multi) { ::Ethon::Multi.new }
@@ -61,7 +59,7 @@
6159
end
6260

6361
describe '#perform' do
64-
let(:easy) { EthonSupport.ethon_easy_new }
62+
let(:easy) { Ethon::Easy.new }
6563
let(:easy_span) { spans.find { |span| span.name == 'ethon.request' } }
6664
let(:multi_span) { spans.find { |span| span.name == 'ethon.multi.request' } }
6765
let(:multi) { ::Ethon::Multi.new }

spec/datadog/tracing/contrib/ethon/support/thread_helpers.rb

Lines changed: 0 additions & 22 deletions
This file was deleted.

spec/datadog/tracing/contrib/ethon/typhoeus_integration_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require 'datadog/tracing/contrib/ethon/shared_examples'
44
require 'datadog/tracing/contrib/ethon/integration_context'
5-
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'
65

76
RSpec.describe Datadog::Tracing::Contrib::Ethon do
87
skip_unless_integration_testing_enabled
@@ -18,7 +17,7 @@
1817
#
1918
# This allows us to still ensure that the integration
2019
# itself is leak-free.
21-
EthonSupport.ethon_easy_new
20+
Ethon::Easy.new
2221
end
2322

2423
context 'with Typhoeus request' do

0 commit comments

Comments
 (0)