Skip to content

Commit

Permalink
Update thread profile tests for 3.4 output
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle committed Dec 18, 2024
1 parent 4557633 commit f251289
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions test/new_relic/agent/threading/thread_profile_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ class ThreadProfileTest < Minitest::Test
def setup
setup_fake_threads

@single_trace = [
"irb.rb:69:in `catch'",
"irb.rb:69:in `start'",
"irb:12:in `<main>'"
]
@single_trace = if ruby_3_4_0_or_above?
[
"irb.rb:69:in 'Kernel#catch'",
"irb.rb:69:in 'Object#start'",
"irb:12:in '<main>'"
]
else
[
"irb.rb:69:in `catch'",
"irb.rb:69:in `start'",
"irb:12:in `<main>'"
]
end

@profile = ThreadProfile.new

Expand Down Expand Up @@ -240,6 +248,10 @@ def rec_count_tree_nodes(tree)

count
end

def ruby_3_4_0_or_above?
Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
end
end
end
end

0 comments on commit f251289

Please sign in to comment.