Skip to content

Commit

Permalink
Revert previous changes and check heartbeat_events.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahchen6 committed Feb 14, 2025
1 parent 56e4241 commit 632b334
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions spec/datadog/core/telemetry/component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
end
end

context 'when in fork' do
context 'when in fork', skip: ENV['BATCHED_TASKS'] do
before { skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) }

it do
Expand Down Expand Up @@ -169,7 +169,7 @@
end
end

context 'when in fork' do
context 'when in fork', skip: ENV['BATCHED_TASKS'] do
before { skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) }

it do
Expand Down Expand Up @@ -209,7 +209,7 @@
end
end

context 'when in fork' do
context 'when in fork', skip: ENV['BATCHED_TASKS'] do
before { skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) }

it do
Expand Down Expand Up @@ -245,7 +245,7 @@
expect(worker).to have_received(:enqueue).with(event)
end

context 'when in fork', skip: !Process.respond_to?(:fork) do
context 'when in fork', skip: !Process.respond_to?(:fork) || ENV['BATCHED_TASKS'] do
it do
telemetry
expect_in_fork do
Expand Down
7 changes: 6 additions & 1 deletion spec/datadog/core/telemetry/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@
end
workers.each(&:start)

try_wait_until { heartbeat_events >= 3 }
begin
try_wait_until { heartbeat_events >= 3 }
rescue => e
puts "Test failed. Heartbeat events received: #{heartbeat_events}"
raise e
end

expect(started_events).to be(1)

Expand Down
2 changes: 1 addition & 1 deletion spec/support/synchronization_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'English'

module SynchronizationHelpers
def expect_in_fork(fork_expectations: nil, timeout_seconds: 30)
def expect_in_fork(fork_expectations: nil, timeout_seconds: 10)
fork_expectations ||= proc { |status:, stdout:, stderr:|
expect(status && status.success?).to be(true), "STDOUT:`#{stdout}` STDERR:`#{stderr}"
}
Expand Down

0 comments on commit 632b334

Please sign in to comment.