Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

- name: Start containerized server and dependencies
env:
TEMPORAL_CLI_VERSION: 1.3.1-nexus-links.0
TEMPORAL_CLI_VERSION: 1.4.0
run: |
wget -O temporal_cli.tar.gz https://github.com/temporalio/cli/releases/download/v${TEMPORAL_CLI_VERSION}/temporal_cli_${TEMPORAL_CLI_VERSION}_linux_amd64.tar.gz
tar -xzf temporal_cli.tar.gz
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.temporal.worker;

import static io.temporal.api.enums.v1.VersioningBehavior.VERSIONING_BEHAVIOR_PINNED;
import static io.temporal.api.workflow.v1.VersioningOverride.PinnedOverrideBehavior.PINNED_OVERRIDE_BEHAVIOR_PINNED;
import static org.junit.Assume.assumeTrue;

import com.google.protobuf.ByteString;
Expand Down Expand Up @@ -273,8 +275,7 @@ public void testDynamicWorkflow() {
e ->
e.getEventType() == EventType.EVENT_TYPE_WORKFLOW_TASK_COMPLETED
&& e.getWorkflowTaskCompletedEventAttributes().getVersioningBehavior()
== io.temporal.api.enums.v1.VersioningBehavior
.VERSIONING_BEHAVIOR_PINNED));
== VERSIONING_BEHAVIOR_PINNED));
}

public static class TestWorkerVersioningMissingAnnotation extends QueueLoop
Expand Down Expand Up @@ -353,8 +354,7 @@ public void testWorkflowsCanUseDefaultVersioningBehaviorWhenSpecified() {
e ->
e.getEventType() == EventType.EVENT_TYPE_WORKFLOW_TASK_COMPLETED
&& e.getWorkflowTaskCompletedEventAttributes().getVersioningBehavior()
== io.temporal.api.enums.v1.VersioningBehavior
.VERSIONING_BEHAVIOR_PINNED));
== VERSIONING_BEHAVIOR_PINNED));
}

@WorkflowInterface
Expand Down Expand Up @@ -426,9 +426,9 @@ public void testWorkflowsCanUseVersioningOverride() {
e.getEventType() == EventType.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED
&& e.getWorkflowExecutionStartedEventAttributes()
.getVersioningOverride()
.getPinned()
.getBehavior()
== io.temporal.api.enums.v1.VersioningBehavior
.VERSIONING_BEHAVIOR_PINNED));
== PINNED_OVERRIDE_BEHAVIOR_PINNED));
}

@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void testSuccessfulActivity() throws InterruptedException {
PendingActivityInfo actual = asserter.getActual().getPendingActivities(0);

// No fancy asserter type for PendingActivityInfo... we just build the expected proto
PendingActivityInfo expected =
PendingActivityInfo.Builder expected =
PendingActivityInfo.newBuilder()
.setActivityId(actual.getActivityId())
.setActivityType(ActivityType.newBuilder().setName("TestDescribeActivity").build())
Expand All @@ -160,10 +160,13 @@ public void testSuccessfulActivity() throws InterruptedException {
// going to run against the real server.
.setScheduledTime(actual.getScheduledTime())
.setLastStartedTime(actual.getLastStartedTime())
.setExpirationTime(actual.getExpirationTime())
.build();
.setExpirationTime(actual.getExpirationTime());

Assert.assertEquals("PendingActivityInfo should match before", expected, actual);
if (actual.hasActivityOptions()) {
// If the activity options are present, we can assert them
expected.setActivityOptions(actual.getActivityOptions());
}
Assert.assertEquals("PendingActivityInfo should match before", expected.build(), actual);

// Make the activity heartbeat - this should show in the next describe call
ThreadUtils.waitForWorkflow(token + "-heartbeat");
Expand All @@ -181,11 +184,11 @@ public void testSuccessfulActivity() throws InterruptedException {

// Now, our PendingActivityInfo has heartbeat data, but is otherwise unchanged
expected =
expected.toBuilder()
expected
.setHeartbeatDetails(DescribeWorkflowAsserter.stringsToPayloads("heartbeatDetails"))
.setLastHeartbeatTime(actual.getLastHeartbeatTime())
.build();
Assert.assertEquals("PendingActivityInfo should match after heartbeat", expected, actual);
.setLastHeartbeatTime(actual.getLastHeartbeatTime());
Assert.assertEquals(
"PendingActivityInfo should match after heartbeat", expected.build(), actual);

// Let the activity finish, which will let the workflow finish.
ThreadUtils.waitForWorkflow(token + "-finish");
Expand Down Expand Up @@ -241,7 +244,7 @@ public void testFailedActivity() throws InterruptedException {
"Activity was asked to fail on attempt 1",
actual.getLastFailure().getMessage());

PendingActivityInfo expected =
PendingActivityInfo.Builder expected =
PendingActivityInfo.newBuilder()
.setActivityId(actual.getActivityId())
.setActivityType(ActivityType.newBuilder().setName("TestDescribeActivity").build())
Expand All @@ -258,10 +261,13 @@ public void testFailedActivity() throws InterruptedException {
// it.
.setLastWorkerIdentity(actual.getLastWorkerIdentity())
// We don't deeply assert the failure structure since we asserted the message above
.setLastFailure(actual.getLastFailure())
.build();
.setLastFailure(actual.getLastFailure());
if (actual.hasActivityOptions()) {
// If the activity options are present, we can assert them
expected.setActivityOptions(actual.getActivityOptions());
}

Assert.assertEquals("PendingActivityInfo should match", expected, actual);
Assert.assertEquals("PendingActivityInfo should match", expected.build(), actual);

// Now let the workflow succeed
ThreadUtils.waitForWorkflow(token + "-finish");
Expand Down Expand Up @@ -311,7 +317,7 @@ private void testKilledWorkflow(

PendingActivityInfo actual = asserter.getActual().getPendingActivities(0);

PendingActivityInfo expected =
PendingActivityInfo.Builder expected =
PendingActivityInfo.newBuilder()
.setActivityId(actual.getActivityId())
.setActivityType(ActivityType.newBuilder().setName("TestDescribeActivity").build())
Expand All @@ -325,10 +331,13 @@ private void testKilledWorkflow(
.setExpirationTime(actual.getExpirationTime())
// this ends up being a dummy value, but if it weren't, we still wouldn't expect to know
// it.
.setLastWorkerIdentity(actual.getLastWorkerIdentity())
.build();
.setLastWorkerIdentity(actual.getLastWorkerIdentity());
if (actual.hasActivityOptions()) {
// If the activity options are present, we can assert them
expected.setActivityOptions(actual.getActivityOptions());
}

Assert.assertEquals("PendingActivityInfo should match", expected, actual);
Assert.assertEquals("PendingActivityInfo should match", expected.build(), actual);
}

@Test
Expand Down
Loading