Skip to content

Add standalone activity validate token tests#8882

Merged
fretz12 merged 8 commits intotemporalio:mainfrom
fretz12:fredtzeng/saa-validate-token-tests
Jan 9, 2026
Merged

Add standalone activity validate token tests#8882
fretz12 merged 8 commits intotemporalio:mainfrom
fretz12:fredtzeng/saa-validate-token-tests

Conversation

@fretz12
Copy link
Contributor

@fretz12 fretz12 commented Dec 19, 2025

What changed?

  • Added token validation tests for activity complete, fail, and cancel. Refactored test layout.
  • Update activity proto docs. Removed TODOs.
  • Changed activity closeTime and executionDuration to always be non-nil when the activity is in terminal state
  • Add validation on complete/fail/cancel/heartbeat token to ensure chasmRef namespace ID matches that of the request

Why?

As part of completing TODOs and cleanup of standalone activities.
Any terminal state, including cancel, termination and timeout, should have a non-nil closeTime and executionDuration.
We need to prevent any mismatches in request vs Token namespace.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • [] added new unit test(s)
  • added new functional test(s)

@fretz12 fretz12 requested review from a team as code owners December 19, 2025 21:26
@fretz12 fretz12 requested a review from dandavison December 19, 2025 21:40
@fretz12 fretz12 force-pushed the fredtzeng/saa-validate-token-tests branch from 155e15d to f84d121 Compare December 23, 2025 18:10
@fretz12 fretz12 requested a review from bergundy January 8, 2026 00:20
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I skimmed most of the tests but the ones I read LGTM.

@fretz12 fretz12 merged commit fe4c718 into temporalio:main Jan 9, 2026
61 checks passed
@fretz12 fretz12 deleted the fredtzeng/saa-validate-token-tests branch January 9, 2026 17:33
stephanos pushed a commit to stephanos/temporal that referenced this pull request Jan 12, 2026
## What changed?
- Added token validation tests for activity complete, fail, and cancel.
Refactored test layout.
- Update activity proto docs. Removed TODOs.
- Changed activity closeTime and executionDuration to always be non-nil
when the activity is in terminal state
- Add validation on complete/fail/cancel/heartbeat token to ensure
chasmRef namespace ID matches that of the request

## Why?
As part of completing TODOs and cleanup of standalone activities. 
Any terminal state, including cancel, termination and timeout, should
have a non-nil closeTime and executionDuration.
We need to prevent any mismatches in request vs Token namespace.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [X] covered by existing tests
- [] added new unit test(s)
- [X] added new functional test(s)
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