Skip to content
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

SDKTestWorkflowRule wasn't calling shutdown #2243

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void testSaga() {
"activity customActivity1",
"executeChildWorkflow TestNoArgsWorkflowFunc",
"interceptExecuteWorkflow " + SDKTestWorkflowRule.UUID_REGEXP,
"registerUpdateHandlers update",
"newThread workflow-method",
"executeActivity ThrowIO",
"activity ThrowIO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public void testParallelLocalActivities() {
expected.add("newThread workflow-method");
for (int i = 0; i < TestParallelLocalActivitiesWorkflowImpl.COUNT; i++) {
expected.add("executeLocalActivity SleepActivity");
expected.add("currentTimeMillis");
}
for (int i = 0; i < TestParallelLocalActivitiesWorkflowImpl.COUNT; i++) {
expected.add("local activity SleepActivity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,10 @@ public void testLocalActivity() {
"interceptExecuteWorkflow " + SDKTestWorkflowRule.UUID_REGEXP,
"newThread workflow-method",
"executeLocalActivity ThrowIO",
"currentTimeMillis",
"local activity ThrowIO",
"local activity ThrowIO",
"local activity ThrowIO",
"executeLocalActivity Activity2",
"currentTimeMillis",
"local activity Activity2",
"executeActivity Activity2",
"activity Activity2");
Expand Down Expand Up @@ -115,12 +113,10 @@ public void testLocalActivityNoInput() {
"interceptExecuteWorkflow " + SDKTestWorkflowRule.UUID_REGEXP,
"newThread workflow-method",
"executeLocalActivity ThrowIO",
"currentTimeMillis",
"local activity ThrowIO",
"local activity ThrowIO",
"local activity ThrowIO",
"executeLocalActivity Activity2",
"currentTimeMillis",
"local activity Activity2",
"executeActivity Activity2",
"activity Activity2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ public void testUpsertSearchAttributes() {
"interceptExecuteWorkflow " + SDKTestWorkflowRule.UUID_REGEXP,
"newThread workflow-method",
"upsertSearchAttributes",
"executeActivity Activity",
"activity Activity");
"sleep PT0.1S",
"upsertSearchAttributes",
"sleep PT0.1S",
"upsertSearchAttributes",
"upsertSearchAttributes",
"sleep PT0.1S");
testWorkflowRule.assertHistoryEvent(
execution.getWorkflowId(), EventType.EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ public void testUpsertSearchAttributes() {
.setExpected(
"interceptExecuteWorkflow " + SDKTestWorkflowRule.UUID_REGEXP,
"newThread workflow-method",
"upsertSearchAttributes",
"executeActivity Activity",
"activity Activity");
"upsertTypedSearchAttributes",
"sleep PT0.1S",
"upsertTypedSearchAttributes",
"sleep PT0.1S",
"upsertTypedSearchAttributes",
"upsertTypedSearchAttributes",
"sleep PT0.1S",
"upsertTypedSearchAttributes",
"upsertTypedSearchAttributes",
"upsertTypedSearchAttributes");
testWorkflowRule.assertHistoryEvent(
execution.getWorkflowId(), EventType.EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,14 @@ public SDKTestWorkflowRule build() {
}

public Statement apply(@Nonnull Statement base, Description description) {
Statement testWorkflowStatement = base;
Statement testWorkflowStatement =
new Statement() {
@Override
public void evaluate() throws Throwable {
base.evaluate();
shutdown();
}
};

Test annotation = description.getAnnotation(Test.class);
boolean timeoutIsOverriddenOnTestAnnotation = annotation != null && annotation.timeout() > 0;
Expand Down
Loading