Skip to content

Commit 2b34dbe

Browse files
authored
Fix for TaskRunErrorCodes.MAX_DURATION_EXCEEDED error saying ms when it’s seconds (#1848)
1 parent 394f1de commit 2b34dbe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/core/src/v3/workers/taskExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ export class TaskExecutor {
383383
reject(
384384
new InternalError({
385385
code: TaskRunErrorCodes.MAX_DURATION_EXCEEDED,
386-
message: `Task execution exceeded maximum duration of ${maxDuration}ms`,
386+
message: `Run exceeded maximum compute time (maxDuration) of ${maxDuration} seconds`,
387387
})
388388
);
389389
});

packages/core/test/taskExecutor.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ describe("TaskExecutor", () => {
14601460

14611461
test("should handle max duration abort signal and call hooks in correct order", async () => {
14621462
const executionOrder: string[] = [];
1463-
const maxDurationMs = 1000;
1463+
const maxDurationSeconds = 1000;
14641464

14651465
// Create an abort controller that we'll trigger manually
14661466
const controller = new AbortController();
@@ -1482,7 +1482,7 @@ describe("TaskExecutor", () => {
14821482
fn: async ({ error }) => {
14831483
executionOrder.push("failure");
14841484
expect((error as Error).message).toBe(
1485-
`Task execution exceeded maximum duration of ${maxDurationMs}ms`
1485+
`Run exceeded maximum compute time (maxDuration) of ${maxDurationSeconds} seconds`
14861486
);
14871487
},
14881488
});
@@ -1537,7 +1537,7 @@ describe("TaskExecutor", () => {
15371537
error: {
15381538
type: "INTERNAL_ERROR",
15391539
code: TaskRunErrorCodes.MAX_DURATION_EXCEEDED,
1540-
message: "Task execution exceeded maximum duration of 1000ms",
1540+
message: "Run exceeded maximum compute time (maxDuration) of 1000 seconds",
15411541
stackTrace: expect.any(String),
15421542
},
15431543
skippedRetrying: false,

0 commit comments

Comments
 (0)