Skip to content

Commit f7855f9

Browse files
committed
build: update p-queue and adjust for breaking changes
Updates p-queue and adjusts for breaking changes.
1 parent fe8c2a8 commit f7855f9

File tree

5 files changed

+62
-67
lines changed

5 files changed

+62
-67
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"limiter": "^3.0.0",
7575
"marked": "^16.1.1",
7676
"node-fetch": "^3.3.2",
77-
"p-queue": "^8.1.0",
77+
"p-queue": "^9.0.0",
7878
"puppeteer": "^24.10.1",
7979
"sass": "^1.89.2",
8080
"strict-csp": "^1.1.1",

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runner/orchestration/gateways/local_gateway.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export class LocalGateway implements Gateway<LocalEnvironment> {
8484
reject(err);
8585
});
8686
}),
87-
{throwOnTimeout: true},
8887
);
8988
}
9089

runner/orchestration/generate.ts

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -152,60 +152,57 @@ export async function generateCodeAndAssess(options: {
152152

153153
for (const rootPromptDef of promptsToProcess) {
154154
allTasks.push(
155-
appConcurrencyQueue.add(
156-
async () => {
157-
const evalID = await env.gateway.initializeEval();
158-
let results: AssessmentResult[] | undefined;
159-
160-
try {
161-
results = await callWithTimeout(
162-
`Evaluation of ${rootPromptDef.name}`,
163-
async abortSignal =>
164-
startEvaluationTask(
165-
evalID,
166-
env,
167-
env.gateway,
168-
ratingLlm,
169-
options.model,
170-
rootPromptDef,
171-
options.localMode,
172-
options.skipScreenshots,
173-
options.outputDirectory,
174-
options.ragEndpoint,
175-
abortSignal,
176-
options.skipAxeTesting,
177-
!!options.enableUserJourneyTesting,
178-
!!options.enableAutoCsp,
179-
workerConcurrencyQueue,
180-
progress,
181-
options.autoraterModel || DEFAULT_AUTORATER_MODEL_NAME,
182-
options.a11yRepairAttempts ?? 0,
183-
),
184-
// 10min max per app evaluation. We just want to make sure it never gets stuck.
185-
10,
186-
);
187-
return results;
188-
} catch (e: unknown) {
189-
failedPrompts.push({
190-
promptName: rootPromptDef.name,
191-
error: `${e}`,
192-
stack: e instanceof Error ? e.stack : undefined,
193-
});
194-
195-
let details = `Error: ${e}`;
196-
if (e instanceof Error && e.stack) {
197-
details += `\nStack: ${e.stack}`;
198-
}
199-
200-
progress.log(rootPromptDef, 'error', 'Failed to evaluate code', details);
201-
return [] satisfies AssessmentResult[];
202-
} finally {
203-
progress.evalFinished(rootPromptDef, results || []);
204-
await env.gateway.finalizeEval(evalID);
155+
appConcurrencyQueue.add(async () => {
156+
const evalID = await env.gateway.initializeEval();
157+
let results: AssessmentResult[] | undefined;
158+
159+
try {
160+
results = await callWithTimeout(
161+
`Evaluation of ${rootPromptDef.name}`,
162+
async abortSignal =>
163+
startEvaluationTask(
164+
evalID,
165+
env,
166+
env.gateway,
167+
ratingLlm,
168+
options.model,
169+
rootPromptDef,
170+
options.localMode,
171+
options.skipScreenshots,
172+
options.outputDirectory,
173+
options.ragEndpoint,
174+
abortSignal,
175+
options.skipAxeTesting,
176+
!!options.enableUserJourneyTesting,
177+
!!options.enableAutoCsp,
178+
workerConcurrencyQueue,
179+
progress,
180+
options.autoraterModel || DEFAULT_AUTORATER_MODEL_NAME,
181+
options.a11yRepairAttempts ?? 0,
182+
),
183+
// 10min max per app evaluation. We just want to make sure it never gets stuck.
184+
10,
185+
);
186+
return results;
187+
} catch (e: unknown) {
188+
failedPrompts.push({
189+
promptName: rootPromptDef.name,
190+
error: `${e}`,
191+
stack: e instanceof Error ? e.stack : undefined,
192+
});
193+
194+
let details = `Error: ${e}`;
195+
if (e instanceof Error && e.stack) {
196+
details += `\nStack: ${e.stack}`;
205197
}
206-
},
207-
{throwOnTimeout: true},
208-
),
198+
199+
progress.log(rootPromptDef, 'error', 'Failed to evaluate code', details);
200+
return [] satisfies AssessmentResult[];
201+
} finally {
202+
progress.evalFinished(rootPromptDef, results || []);
203+
await env.gateway.finalizeEval(evalID);
204+
}
205+
}),
209206
);
210207
}
211208

runner/orchestration/serve-testing-worker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export async function serveAndTestApp(
7373
reject(err);
7474
});
7575
}),
76-
{throwOnTimeout: true},
7776
);
7877
},
7978
);

0 commit comments

Comments
 (0)