temporalio / temporalio/sdk-java
WorkflowClient#execute doesn't pair correctly with workflowStub.getResult()
Open
@tsurdilo is already working on this.
Since Jan 21, 2022.
bug
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
Actual behavior
@Test
public void executeAndGetResultFromStub() throws InterruptedException, ExecutionException {
TestNoArgsWorkflowProc stubP =
testWorkflowRule.newWorkflowStubTimeoutOptions(TestNoArgsWorkflowProc.class);
WorkflowStub workflowStub = WorkflowStub.fromTyped(stubP);
CompletableFuture<Void> executeCF = WorkflowClient.execute(stubP::proc);
// This test hangs (times out), but uncommenting of either if these two lines makes it
// pass, which doesn't make much sense
// sleep(1000);
// executeCF.get();
workflowStub.getResult(Void.class);
}
This unit test for a trivial workflow, that finishes immediately, hangs.
Uncommenting on either sleep or waiting for a completable future makes it pass.
Replacing execute with start (that returns WorkflowExecution) also makes this test pass.
Expected behavior
The test passes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.