-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support terminate-if-running workflow ID reuse policy in test server #1683
Support terminate-if-running workflow ID reuse policy in test server #1683
Conversation
e1aa098
to
632f37b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thank you for your contribution.
try { | ||
workflowStub.execute(); | ||
} catch (WorkflowFailedException e) { | ||
// Expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's expected, you may consider asserting it with assertThrows
.
import org.junit.Test; | ||
|
||
/** | ||
* Server should discard repeated workflow task failures and let the workflow task to time out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a relevant comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, copy/paste leftovers. I'll remove it.
632f37b
to
76aa3cd
Compare
@Spikhalskiy Removed that comment, and asserted the expected exception. |
What was changed
Terminates any existing execution in the test service when the terminate-if-running workflow ID reuse policy is specified. A new test has been added for this case, but also some basic workflow ID reuse policy test cases.
Why?
Starting a workflow with this policy when another is already running throws
WorkflowExecutionAlreadyStarted
rather than the existing execution being terminated and a new run being started.Checklist
Closes Add support for TerminateIfRunning WorkflowIdReusePolicy in Test Server #1682
How was this tested:
New unit tests in
temporal-test-server/src/test/java/io/temporal/testserver/functional/WorkflowIdReusePolicyTest.java