Skip to content

Commit fafbccf

Browse files
authored
docs: Clarify some drawbacks of ephemeral servers, and other minor fixes (#1478)
1 parent cc6ee3b commit fafbccf

File tree

4 files changed

+43
-18
lines changed

4 files changed

+43
-18
lines changed

packages/client/src/connection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ function addDefaults(options: ConnectionOptions): ConnectionOptionsWithDefaults
143143
'grpc.keepalive_permit_without_calls': 1,
144144
'grpc.keepalive_time_ms': 30_000,
145145
'grpc.keepalive_timeout_ms': 15_000,
146+
max_receive_message_length: 128 * 1024 * 1024, // 128 MB
146147
...channelArgs,
147148
},
148149
interceptors: interceptors ?? [makeGrpcRetryInterceptor(defaultGrpcRetryOptions())],

packages/client/src/schedule-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface ScheduleOptions<A extends ScheduleOptionsAction = ScheduleOptio
4141
* takes those Actions according to the {@link ScheduleOverlapPolicy}. An outage that lasts longer than the Catchup
4242
* Window could lead to missed Actions. (But you can always {@link ScheduleHandle.backfill}.)
4343
*
44-
* @default 1 minute
44+
* @default 1 year
4545
* @format number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string}
4646
*/
4747
catchupWindow?: Duration;

packages/core-bridge/ts/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,16 @@ export interface TimeSkippingServerConfig {
421421
port?: number;
422422
/**
423423
* Extra args to pass to the executable command.
424+
*
425+
* Note that the Test Server implementation may be changed to another one in the future. Therefore, there is
426+
* no guarantee that server options, and particularly those provided through the `extraArgs` array, will continue to
427+
* be supported in the future.
424428
*/
425429
extraArgs?: string[];
426430
}
427431

428432
/**
429-
* Configuration for the Temporal CLI dev server.
433+
* Configuration for the Temporal CLI Dev Server.
430434
*/
431435
export interface DevServerConfig {
432436
type: 'dev-server';
@@ -464,14 +468,18 @@ export interface DevServerConfig {
464468
port?: number;
465469
/**
466470
* Extra args to pass to the executable command.
471+
*
472+
* Note that the Dev Server implementation may be changed to another one in the future. Therefore, there is no
473+
* guarantee that Dev Server options, and particularly those provided through the `extraArgs` array, will continue to
474+
* be supported in the future.
467475
*/
468476
extraArgs?: string[];
469477
}
470478

471479
/**
472480
* Configuration for spawning an ephemeral Temporal server.
473481
*
474-
* Both the time-skipping test server and Temporal CLI dev server are supported.
482+
* Both the time-skipping Test Server and Temporal CLI dev server are supported.
475483
*/
476484
export type EphemeralServerConfig = TimeSkippingServerConfig | DevServerConfig;
477485

packages/testing/src/index.ts

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,22 +226,32 @@ export class TestWorkflowEnvironment {
226226
/**
227227
* Start a time skipping workflow environment.
228228
*
229-
* By default, this environment will automatically skip to the next events in time when a workflow handle's `result`
230-
* is awaited on (which includes {@link WorkflowClient.execute}). Before the result is awaited on, time can be
231-
* manually skipped forward using {@link sleep}. The currently known time can be obtained via {@link currentTimeMs}.
229+
* This environment automatically skips to the next events in time when a workflow handle's `result` is awaited on
230+
* (which includes {@link WorkflowClient.execute}). Before the result is awaited on, time can be manually skipped
231+
* forward using {@link sleep}. The currently known time can be obtained via {@link currentTimeMs}.
232232
*
233-
* Internally, this environment lazily downloads a test-server binary for the current OS/arch from the [Java SDK
234-
* releases](https://github.com/temporalio/sdk-java/releases) into the temp directory if it is not already there.
235-
* Then the executable is started and will be killed when {@link teardown} is called.
233+
* This environment will be powered by the Temporal Time Skipping Test Server (part of the [Java SDK](https://github.com/temporalio/sdk-java)).
234+
* Note that the Time Skipping Test Server does not support full capabilities of the regular Temporal Server, and may
235+
* occasionally present different behaviors. For general Workflow testing, it is generally preferable to use {@link createLocal}
236+
* instead.
236237
*
237238
* Users can reuse this environment for testing multiple independent workflows, but not concurrently. Time skipping,
238239
* which is automatically done when awaiting a workflow result and manually done on sleep, is global to the
239-
* environment, not to the workflow under test.
240+
* environment, not to the workflow under test. We highly recommend running tests serially when using a single
241+
* environment or creating a separate environment per test.
240242
*
241-
* We highly recommend, running tests serially when using a single environment or creating a separate environment per
242-
* test.
243+
* By default, the latest release of the Test Serveer will be downloaded and cached to a temporary directory
244+
* (e.g. `$TMPDIR/temporal-test-server-sdk-typescript-*` or `%TEMP%/temporal-test-server-sdk-typescript-*.exe`). Note
245+
* that existing cached binairies will be reused without validation that they are still up-to-date, until the SDK
246+
* itself is updated. Alternatively, a specific version number of the Test Server may be provided, or the path to an
247+
* existing Test Server binary may be supplied; see {@link LocalTestWorkflowEnvironmentOptions.server.executable}.
243248
*
244-
* In the future, the test server implementation may be changed to another implementation.
249+
* Note that the Test Server implementation may be changed to another one in the future. Therefore, there is no
250+
* guarantee that Test Server options, and particularly those provided through the `extraArgs` array, will continue to
251+
* be supported in the future.
252+
*
253+
* IMPORTANT: At this time, the Time Skipping Test Server is not supported on ARM platforms. Execution on Apple
254+
* silicon Macs will work if Rosetta 2 is installed.
245255
*/
246256
static async createTimeSkipping(opts?: TimeSkippingTestWorkflowEnvironmentOptions): Promise<TestWorkflowEnvironment> {
247257
return await this.create({
@@ -252,19 +262,25 @@ export class TestWorkflowEnvironment {
252262
}
253263

254264
/**
255-
* Start a full Temporal server locally, downloading if necessary.
265+
* Start a full Temporal server locally.
256266
*
257267
* This environment is good for testing full server capabilities, but does not support time skipping like
258268
* {@link createTimeSkipping} does. {@link supportsTimeSkipping} will always return `false` for this environment.
259269
* {@link sleep} will sleep the actual amount of time and {@link currentTimeMs} will return the current time.
260270
*
261271
* This local environment will be powered by [Temporal CLI](https://github.com/temporalio/cli), which is a
262272
* self-contained executable for Temporal. By default, Temporal's database will not be persisted to disk, and no UI
263-
* will be started.
273+
* will be launched.
274+
*
275+
* By default, the latest release of the CLI will be downloaded and cached to a temporary directory
276+
* (e.g. `$TMPDIR/temporal-sdk-typescript-*` or `%TEMP%/temporal-sdk-typescript-*.exe`). Note that existing cached
277+
* binairies will be reused without validation that they are still up-to-date, until the SDK itself is updated.
278+
* Alternatively, a specific version number of the CLI may be provided, or the path to an existing CLI binary may be
279+
* supplied; see {@link LocalTestWorkflowEnvironmentOptions.server.executable}.
264280
*
265-
* The CLI executable will be downloaded and cached to a temporary directory. See
266-
* {@link LocalTestWorkflowEnvironmentOptions.server.executable.type} if you'd prefer to provide the CLI executable
267-
* yourself.
281+
* Note that the Dev Server implementation may be changed to another one in the future. Therefore, there is no
282+
* guarantee that Dev Server options, and particularly those provided through the `extraArgs` array, will continue to
283+
* be supported in the future.
268284
*/
269285
static async createLocal(opts?: LocalTestWorkflowEnvironmentOptions): Promise<TestWorkflowEnvironment> {
270286
return await this.create({

0 commit comments

Comments
 (0)