Skip to content

fix(testing): accept detail_hints in ActivityEnvironment heartbeat - #626

Merged
chris-olszewski merged 1 commit into
temporalio:mainfrom
RaphaelFakhri:fix-activity-env-heartbeat-hints
Oct 19, 2026
Merged

chris-olszewski merged 1 commit into
temporalio:mainfrom
RaphaelFakhri:fix-activity-env-heartbeat-hints

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

What changed

Temporalio::Testing::ActivityEnvironment now accepts the detail_hints: keyword on Activity::Context#heartbeat, matching the signature of the base Activity::Context and the worker's context. The hints are ignored, because the test environment passes heartbeat details to on_heartbeat without converting them.

Why

The test context defined heartbeat(*details) with no keyword parameters. Ruby converts the keyword argument to a positional Hash in that case, so an activity that calls heartbeat('progress', detail_hints: [hint]) gets ['progress', {detail_hints: [hint]}] in its on_heartbeat callback. The worker records only ['progress'], so the test sees different details than production does.

Validation

  • Extended test_heartbeating in test/testing/activity_environment_test.rb with a heartbeat that passes detail_hints:.
  • Without the fix, test_heartbeating and test_heartbeating_in_fiber fail: expected ["with-hints"], got ["with-hints", {detail_hints: [:some_hint]}].
  • With the fix, bundle exec ruby -Ilib -Itest test/testing/activity_environment_test.rb reports 10 runs, 0 failures, 1 skip (the existing skip).
  • bundle exec rubocop on the changed Ruby files and bundle exec steep check lib/temporalio/testing/activity_environment.rb pass.
  • Added a changelog fragment under changelog/fixed/.

@RaphaelFakhri
RaphaelFakhri requested a review from a team as a code owner October 18, 2026 11:17
@chris-olszewski
chris-olszewski merged commit 942f67f into temporalio:main Oct 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants