• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-go / 21052039502
61%

Build:
DEFAULT BRANCH: master
Ran 16 Jan 2026 01:28AM UTC
Jobs 1
Files 135
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Jan 2026 01:08AM UTC coverage: 61.239% (+0.1%) from 61.109%
21052039502

push

github

web-flow
Enforce heartbeat and start-to-close timeouts in test environment (#2144)

* Enforce heartbeat and start-to-close timeouts in test environment

This extends the existing heartbeat timeout enforcement to also enforce
StartToCloseTimeout in the test environment. The implementation uses a
unified timeout monitoring goroutine that checks both timeout types.

Changes:
- Renamed heartbeatTimeoutResult to activityTimeoutResult with timeoutType field
- Extended testActivityHandle to track both timeout types and activity start time
- Unified monitoring goroutine checks both heartbeat and start-to-close timeouts
- The timeout that fires first wins (heartbeat if shorter, start-to-close otherwise)

This addresses https://github.com/temporalio/sdk-go/issues/1282

* Fix StartToCloseTimeout cause to be context.DeadlineExceeded

When the monitoring goroutine detects a StartToCloseTimeout, the
cause should be context.DeadlineExceeded since we set up the context
deadline to match the timeout. This maintains backward compatibility
with the existing Test_ActivityDeadlineExceeded test which expects
the timeout error's cause to be "context deadline exceeded".

* Add configurable grace period for activity timeout enforcement

Add SetActivityTimeoutGracePeriod() method to TestWorkflowEnvironment
that allows configuring how long the test framework waits after the
StartToCloseTimeout expires before forcibly timing out activities.

This gives well-behaved activities that respect ctx.Done() a chance to
return gracefully before being timed out externally. Default is 0 (no
grace period) to maintain backward compatibility.

* Add tests for SetActivityTimeoutGracePeriod option

Add two tests to verify the grace period behavior:
- Test_ActivityStartToCloseTimeout_GracePeriod: Verifies that an activity
  completing within timeout + grace period times out via the normal
  context.DeadlineExceeded path (not the monitoring goroutine)
- Test_ActivityStartToCloseTimeout_GracePeriodExceeded... (continued)

18951 of 30946 relevant lines covered (61.24%)

16591.96 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
3
77.65
0.47% internal_task_pollers.go
48
69.94
0.19% workflow_testsuite.go
555
69.76
0.96% internal_workflow_testsuite.go
Jobs
ID Job ID Ran Files Coverage
1 21052039502.1 16 Jan 2026 01:28AM UTC 135
61.24
GitHub Action Run
Source Files on build 21052039502
  • Tree
  • List 135
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #21052039502
  • 1c03dbf0 on github
  • Prev Build on master (#20934019289)
  • Next Build on master (#21368125485)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc