Skip to content

Commit aec754c

Browse files
authored
fix(workflow): Make Local Activily timeouts in ActivityInfo match those of non-Local Activities (#1133)
1 parent 38b81d3 commit aec754c

File tree

12 files changed

+569
-442
lines changed

12 files changed

+569
-442
lines changed

packages/activity/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,8 @@ export interface Info {
176176
scheduledTimestampMs: number;
177177
/**
178178
* Timeout for this Activity from schedule to close in milliseconds.
179-
*
180-
* Might be undefined for local activities.
181179
*/
182-
scheduleToCloseTimeoutMs?: number;
180+
scheduleToCloseTimeoutMs: number;
183181
/**
184182
* Timeout for this Activity from start to close in milliseconds
185183
*/

packages/common/src/activity-options.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ export interface LocalActivityOptions {
137137

138138
/**
139139
* Indicates how long the caller is willing to wait for local activity completion. Limits how
140-
* long retries will be attempted. When not specified defaults to the workflow execution
141-
* timeout (which may be unset).
140+
* long retries will be attempted.
142141
*
143142
* Either this option or {@link startToCloseTimeout} is required.
144143
*

packages/core-bridge/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ prost = "0.11"
2626
prost-types = "0.11"
2727
tokio = "1.13"
2828
once_cell = "1.7.2"
29-
temporal-sdk-core = { version = "*", path = "./sdk-core/core" }
29+
temporal-sdk-core = { version = "*", path = "./sdk-core/core", features = ["ephemeral-server"] }
3030
temporal-client = { version = "*", path = "./sdk-core/client" }
3131
tokio-stream = "0.1"

packages/core-bridge/sdk-core

Submodule sdk-core updated 46 files

packages/test/src/activities/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ export async function echo(message?: string): Promise<string> {
2121
return message;
2222
}
2323

24-
export async function isLocal(): Promise<boolean> {
25-
return Context.current().info.isLocal;
26-
}
27-
2824
export async function httpGet(url: string): Promise<string> {
2925
return `<html><body>hello from ${url}</body></html>`;
3026
}

packages/test/src/integration-tests.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,22 +1314,6 @@ export function runIntegrationTests(codec?: PayloadCodec): void {
13141314
});
13151315
}
13161316

1317-
test('issue-731', async (t) => {
1318-
const { client } = t.context;
1319-
const workflowId = uuid4();
1320-
await client.execute(workflows.issue731, {
1321-
taskQueue: 'test',
1322-
workflowId,
1323-
workflowTaskTimeout: '1m', // Give our local activities enough time to run in CI
1324-
});
1325-
const history = await client.getHandle(workflowId).fetchHistory();
1326-
if (history?.events == null) {
1327-
throw new Error('Expected non null events');
1328-
}
1329-
// Verify only one timer was scheduled
1330-
t.is(history.events.filter(({ timerStartedEventAttributes }) => timerStartedEventAttributes != null).length, 1);
1331-
});
1332-
13331317
test('Query does not cause condition to be triggered', async (t) => {
13341318
const { client } = t.context;
13351319
const workflowId = uuid4();

0 commit comments

Comments
 (0)