Merged
Conversation
3f2d38e to
9c1447c
Compare
stephanos
commented
Mar 30, 2026
| // WithSdkWorker sets up an SDK client and worker for the test. | ||
| // Cleanup is handled automatically via t.Cleanup(). | ||
| // Deprecated: this option is no longer required and will be removed once all callers have been updated. | ||
| func WithSdkWorker() TestOption { |
Contributor
Author
There was a problem hiding this comment.
Not deleting it here to keep PR simple; can be follow-up PR. But also happy to include that here as well.
9c1447c to
350f6c9
Compare
stephanos
commented
Mar 30, 2026
Comment on lines
+74
to
+77
| sdkClientOnce sync.Once | ||
| sdkClient sdkclient.Client | ||
| sdkWorkerOnce sync.Once | ||
| sdkWorker sdkworker.Worker |
Contributor
Author
There was a problem hiding this comment.
I made both client and worker init separately since but I wasn't sure if there's a use case; I suspect there's maybe a case where you want the client but don't need the worker (e.g. to test server validation?). So I think it's worth keeping since it doesn't cost much complexity.
stephanos
commented
Mar 30, 2026
| t: t, | ||
| tv: testvars.New(t), | ||
| ctx: setupTestTimeoutWithContext(t, options.timeout), | ||
| sdkWorkerTQ: RandomizeStr("tq-" + t.Name()), |
Contributor
Author
There was a problem hiding this comment.
Can be eager; very low overhead.
350f6c9 to
892b484
Compare
stephanos
commented
Mar 30, 2026
| e.t.Fatalf("Failed to start SDK worker: %v", err) | ||
| } | ||
| e.t.Cleanup(func() { e.sdkWorker.Stop() }) | ||
| }) |
Contributor
Author
There was a problem hiding this comment.
^ same code as before
stephanos
commented
Mar 30, 2026
| e.t.Fatalf("Failed to create SDK client: %v", err) | ||
| } | ||
| e.t.Cleanup(func() { e.sdkClient.Close() }) | ||
| }) |
Contributor
Author
There was a problem hiding this comment.
^ same code as before
chaptersix
approved these changes
Mar 31, 2026
chaptersix
added a commit
to chaptersix/temporal
that referenced
this pull request
Apr 2, 2026
## What changed? Deprecate `WithSdkWorker` testEnv option and init it lazily instead. ## Why? Requires less manual setup. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
chaptersix
added a commit
to chaptersix/temporal
that referenced
this pull request
Apr 2, 2026
## What changed? Deprecate `WithSdkWorker` testEnv option and init it lazily instead. ## Why? Requires less manual setup. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
chaptersix
added a commit
that referenced
this pull request
Apr 2, 2026
## What changed? Deprecate `WithSdkWorker` testEnv option and init it lazily instead. ## Why? Requires less manual setup. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
chaptersix
added a commit
to chaptersix/temporal
that referenced
this pull request
Apr 2, 2026
## What changed? Deprecate `WithSdkWorker` testEnv option and init it lazily instead. ## Why? Requires less manual setup. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Deprecate
WithSdkWorkertestEnv option and init it lazily instead.Why?
Requires less manual setup.
How did you test it?