Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shijiesheng committed Nov 7, 2024
1 parent 71f40e2 commit 235a768
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions src/test/java/com/uber/cadence/workflow/WorkflowMigrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.uber.cadence.serviceclient.IWorkflowService;
import com.uber.cadence.serviceclient.WorkflowServiceTChannel;
import com.uber.cadence.testUtils.CadenceTestRule;
import com.uber.cadence.testing.TestWorkflowEnvironment;
import com.uber.cadence.worker.Worker;
import com.uber.cadence.worker.WorkerFactory;
import com.uber.cadence.worker.WorkerFactoryOptions;
Expand All @@ -53,27 +52,14 @@ public class WorkflowMigrationTest {
WorkerFactory factoryCurr, factoryNew;
Worker workerCurr, workerNew;

@Rule
public CadenceTestRule testRuleCur =
CadenceTestRule.builder()
.withDomain(DOMAIN)
.withWorkflowTypes(CrossDomainWorkflowTest.TestWorkflowCrossDomainImpl.class)
.startWorkersAutomatically()
.withTestEnvironmentProvider(TestWorkflowEnvironment::newInstance)
.build();

@Rule
public CadenceTestRule testRuleNew =
CadenceTestRule.builder()
.withDomain(DOMAIN2)
.withWorkflowTypes(WorkflowTest.TestWorkflowSignaledSimple.class)
.startWorkersAutomatically()
.withTestEnvironmentProvider(TestWorkflowEnvironment::newInstance)
.build();
@Rule public CadenceTestRule testRuleCur = CadenceTestRule.builder().withDomain(DOMAIN).build();

@Rule public CadenceTestRule testRuleNew = CadenceTestRule.builder().withDomain(DOMAIN2).build();

@Before
public void setUp() {
IWorkflowService serviceNew, serviceCur;
IWorkflowService serviceCur = testRuleCur.getWorkflowClient().getService();
IWorkflowService serviceNew = testRuleNew.getWorkflowClient().getService();
if (useDockerService) {
serviceCur =
new WorkflowServiceTChannel(
Expand All @@ -82,9 +68,6 @@ public void setUp() {
new FeatureFlags().setWorkflowExecutionAlreadyCompletedErrorEnabled(true))
.build());
serviceNew = serviceCur; // docker only starts one server so share the same service
} else {
serviceCur = testRuleCur.getWorkflowClient().getService();
serviceNew = testRuleNew.getWorkflowClient().getService();
}
workflowClientCurr =
WorkflowClient.newInstance(
Expand Down Expand Up @@ -179,7 +162,6 @@ public void execute(int iter) {

@Test
public void whenUseDockerService_cronWorkflowMigration() {
// Assume.assumeTrue(useDockerService);
String workflowID = UUID.randomUUID().toString();
try {
workflowClientCurr
Expand Down

0 comments on commit 235a768

Please sign in to comment.