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

[Nexus] Make sure workflow options from proxy call are propagated #2310

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 @@ -75,7 +75,7 @@ public static WorkflowStub createNexusBoundStub(
}
WorkflowOptions options = stub.getOptions().get();
WorkflowOptions.Builder nexusWorkflowOptions =
WorkflowOptions.newBuilder()
WorkflowOptions.newBuilder(options)
.setRequestId(request.getRequestId())
.setCompletionCallbacks(
Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import org.junit.Test;

public class AsyncWorkflowOperationTest extends BaseNexusTest {
private static final String WORKFLOW_ID_PREFIX = "test-prefix";

@Rule
public SDKTestWorkflowRule testWorkflowRule =
SDKTestWorkflowRule.newBuilder()
Expand Down Expand Up @@ -86,6 +88,7 @@ public String execute(String input) {
Assert.assertTrue("Operation id should be present", asyncExec.getOperationId().isPresent());
// Result should only be completed if the operation is completed
Assert.assertFalse("Result should not be completed", asyncOpHandle.getResult().isCompleted());
Assert.assertTrue(asyncExec.getOperationId().get().startsWith(WORKFLOW_ID_PREFIX));
// Unblock the operation
Workflow.newExternalWorkflowStub(OperationWorkflow.class, asyncExec.getOperationId().get())
.unblock();
Expand Down Expand Up @@ -129,7 +132,9 @@ public OperationHandler<String, String> operation() {
(context, details, client, input) ->
client.newWorkflowStub(
OperationWorkflow.class,
WorkflowOptions.newBuilder().setWorkflowId(details.getRequestId()).build())
WorkflowOptions.newBuilder()
.setWorkflowId(WORKFLOW_ID_PREFIX + details.getRequestId())
.build())
::execute);
}
}
Expand Down
Loading
Loading