Fix for TaskRunErrorCodes.MAX_DURATION_EXCEEDED error saying ms when it’s seconds (#1848)

This commit is contained in:
Matt Aitken
2025-03-31 14:48:03 +01:00
committed by GitHub
parent 394f1decd3
commit 2b34dbe4b0
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ export class TaskExecutor {
reject(
new InternalError({
code: TaskRunErrorCodes.MAX_DURATION_EXCEEDED,
message: `Task execution exceeded maximum duration of ${maxDuration}ms`,
message: `Run exceeded maximum compute time (maxDuration) of ${maxDuration} seconds`,
})
);
});
+3 -3
View File
@@ -1460,7 +1460,7 @@ describe("TaskExecutor", () => {
test("should handle max duration abort signal and call hooks in correct order", async () => {
const executionOrder: string[] = [];
const maxDurationMs = 1000;
const maxDurationSeconds = 1000;
// Create an abort controller that we'll trigger manually
const controller = new AbortController();
@@ -1482,7 +1482,7 @@ describe("TaskExecutor", () => {
fn: async ({ error }) => {
executionOrder.push("failure");
expect((error as Error).message).toBe(
`Task execution exceeded maximum duration of ${maxDurationMs}ms`
`Run exceeded maximum compute time (maxDuration) of ${maxDurationSeconds} seconds`
);
},
});
@@ -1537,7 +1537,7 @@ describe("TaskExecutor", () => {
error: {
type: "INTERNAL_ERROR",
code: TaskRunErrorCodes.MAX_DURATION_EXCEEDED,
message: "Task execution exceeded maximum duration of 1000ms",
message: "Run exceeded maximum compute time (maxDuration) of 1000 seconds",
stackTrace: expect.any(String),
},
skippedRetrying: false,