Skip to content

Commit e8a6307

Browse files
authored
Merge pull request #4247 from DataDog/anmarchenko/fix_failing_memory_leaks_test
[NOTICKET-1] use Ruby 3.4.1 for test-memcheck GHA + other fixes to bring master CI to green with 3.4
2 parents cf5120d + f88e1c1 commit e8a6307

File tree

5 files changed

+88
-5
lines changed

5 files changed

+88
-5
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ save_bundle_checksum: &save_bundle_checksum
6565
command: |
6666
if [ "$CI_BUNDLE_CACHE_HIT" != 1 ]; then
6767
# Recompute gemfiles/*.lock checksum, as those files might have changed
68-
cat Gemfile Gemfile.lock Appraisals gemfiles/*.gemfile gemfiles/*.gemfile.lock | md5sum > .circleci/bundle_checksum
68+
cat Gemfile Gemfile.lock ruby-*.gemfile gemfiles/*.gemfile gemfiles/*.gemfile.lock | md5sum > .circleci/bundle_checksum
6969
fi
7070
cp .circleci/bundle_checksum /usr/local/bundle/bundle_checksum
7171
step_bundle_install: &step_bundle_install
@@ -96,7 +96,7 @@ step_compute_bundle_checksum: &step_compute_bundle_checksum
9696
# updating the gemset lock files produces extremely large commits.
9797
command: |
9898
bundle lock # Create Gemfile.lock
99-
cat Gemfile Gemfile.lock Appraisals gemfiles/*.gemfile gemfiles/*.gemfile.lock | md5sum > .circleci/bundle_checksum
99+
cat Gemfile Gemfile.lock ruby-*.gemfile gemfiles/*.gemfile gemfiles/*.gemfile.lock | md5sum > .circleci/bundle_checksum
100100
step_get_test_agent_trace_check_results: &step_get_test_agent_trace_check_results
101101
run:
102102
name: Get APM Test Agent Trace Check Results

.github/workflows/test-memory-leaks.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
- uses: actions/checkout@v4
88
- uses: ruby/setup-ruby@v1
99
with:
10-
ruby-version: 3.4.0-preview2 # TODO: Use stable version once 3.4 is out
10+
ruby-version: 3.4.1
1111
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
1212
bundler: latest
13-
cache-version: v1 # bump this to invalidate cache
13+
cache-version: v2 # bump this to invalidate cache
1414
- run: sudo apt-get update && (sudo apt-get install -y valgrind || sleep 5 && sudo apt-get install -y valgrind) && valgrind --version
1515
- run: gem update --system 3.5.23 # TODO: This is a workaround for a buggy rubygems in 3.4.0-preview2; remove once stable version 3.4 is out
1616
- run: bundle exec rake compile spec:profiling:memcheck

integration/images/ruby/3.4/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:3.4.0-preview2
1+
FROM ruby:3.4
22

33
ENV DEBIAN_FRONTEND=noninteractive
44

ruby-3.5.gemfile

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
source 'https://rubygems.org'
2+
3+
gemspec
4+
5+
gem 'base64'
6+
gem 'benchmark-ips', '~> 2.8'
7+
gem 'benchmark-memory', '< 0.2' # V0.2 only works with 2.5+
8+
gem 'bigdecimal'
9+
gem 'climate_control', '~> 0.2.0'
10+
gem 'concurrent-ruby'
11+
12+
# Optional extensions
13+
# TODO: Move this to Appraisals?
14+
# dogstatsd v5, but lower than 5.2, has possible memory leak with datadog.
15+
# @see https://github.com/DataDog/dogstatsd-ruby/issues/182
16+
gem 'dogstatsd-ruby', '>= 3.3.0', '!= 5.0.0', '!= 5.0.1', '!= 5.1.0'
17+
18+
gem 'extlz4', '~> 0.3', '>= 0.3.3'
19+
20+
# Profiler testing dependencies
21+
# NOTE: We're excluding versions 3.7.0 and 3.7.1 for the reasons documented in #1424.
22+
# Since most of our customers won't have BUNDLE_FORCE_RUBY_PLATFORM=true, it's not something we want to add
23+
# to our CI, so we just shortcut and exclude specific versions that were affecting our CI.
24+
gem 'google-protobuf', ['~> 3.0', '!= 3.7.0', '!= 3.7.1']
25+
26+
gem 'json-schema', '< 3' # V3 only works with 2.5+
27+
gem 'memory_profiler', '~> 0.9'
28+
gem 'mutex_m'
29+
gem 'os', '~> 1.1'
30+
gem 'pimpmychangelog', '>= 0.1.2'
31+
gem 'pry'
32+
gem 'pry-stack_explorer'
33+
gem 'rake', '>= 10.5'
34+
gem 'rake-compiler', '~> 1.1', '>= 1.1.1' # To compile native extensions
35+
gem 'rspec', '~> 3.13'
36+
gem 'rspec-collection_matchers', '~> 1.1'
37+
gem 'rspec-wait', '~> 0'
38+
gem 'rspec_junit_formatter', '>= 0.5.1'
39+
40+
# 1.50 is the last version to support Ruby 2.6
41+
gem 'rubocop', '~> 1.50.0', require: false
42+
gem 'rubocop-packaging', '~> 0.5.2', require: false
43+
gem 'rubocop-performance', '~> 1.9', require: false
44+
# 2.20 is the last version to support Ruby 2.6
45+
gem 'rubocop-rspec', ['~> 2.20', '< 2.21'], require: false
46+
47+
# Merging branch coverage results does not work for old, unsupported rubies and JRuby
48+
# We have a fix up for review, https://github.com/simplecov-ruby/simplecov/pull/972,
49+
# but given it only affects unsupported version of Ruby, it might not get merged.
50+
gem 'simplecov', git: 'https://github.com/DataDog/simplecov', ref: '3bb6b7ee58bf4b1954ca205f50dd44d6f41c57db'
51+
gem 'simplecov-cobertura', '~> 2.1.0' # Used by codecov
52+
53+
gem 'warning', '~> 1' # NOTE: Used in spec_helper.rb
54+
gem 'webmock', '>= 3.10.0'
55+
gem 'webrick', '>= 1.8.2'
56+
57+
group :check do
58+
gem 'rbs', '~> 3.7', require: false
59+
gem 'steep', '~> 1', '>= 1.9.1', require: false
60+
gem 'ruby_memcheck', '>= 3'
61+
gem 'standard', require: false
62+
end
63+
64+
group :dev do
65+
gem 'ruby-lsp', require: false
66+
gem 'appraisal', '~> 2.4.0', require: false
67+
end

suppressions/ruby-3.4.supp

+16
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,19 @@
7777
obj:/usr/bin/tr
7878
...
7979
}
80+
81+
# When a Ruby process forks, it looks like Ruby doesn't clean up the memory of old threads?
82+
{
83+
ruby-native-thread-memory-4
84+
Memcheck:Leak
85+
fun:calloc
86+
fun:calloc1
87+
fun:rb_gc_impl_calloc
88+
fun:ruby_xcalloc_body
89+
fun:ruby_xcalloc
90+
fun:native_thread_alloc
91+
fun:native_thread_create_dedicated
92+
fun:native_thread_create
93+
fun:thread_create_core
94+
...
95+
}

0 commit comments

Comments
 (0)