



























@@ -189,11 +189,15 @@ function runVitestSpec(spec) {
189189if (spec.includeFilePath && spec.includePatterns) {
190190writeVitestIncludeFile(spec.includeFilePath, spec.includePatterns);
191191}
192+let noOutputTimedOut = false;
192193return new Promise((resolve, reject) => {
193194const { child, teardown } = spawnWatchedVitestProcess({
194195pnpmArgs: spec.pnpmArgs,
195196env: spec.env,
196197label: spec.config,
198+onNoOutputTimeout: () => {
199+noOutputTimedOut = true;
200+},
197201spawnParams: {
198202cwd: process.cwd(),
199203 ...resolveVitestSpawnParams(spec.env),
@@ -203,7 +207,7 @@ function runVitestSpec(spec) {
203207child.on("exit", (code, signal) => {
204208teardown();
205209cleanupVitestRunSpec(spec);
206-resolve({ code: code ?? 1, signal });
210+resolve({ code: code ?? (signal ? 143 : 1), noOutputTimedOut, signal });
207211});
208212209213child.on("error", (error) => {
@@ -231,8 +235,21 @@ function applyDefaultParallelVitestWorkerBudget(specs, env) {
231235async function runLoggedVitestSpec(spec) {
232236console.error(`[test] starting ${spec.config}`);
233237const startedAt = performance.now();
234-const result = await runVitestSpec(spec);
238+let result = await runVitestSpec(spec);
239+if (result.noOutputTimedOut && !spec.watchMode) {
240+console.error(`[test] retrying ${spec.config} after no-output timeout`);
241+result = await runVitestSpec(spec);
242+}
235243const durationMs = performance.now() - startedAt;
244+if (result.noOutputTimedOut && result.signal) {
245+console.error(`[test] ${spec.config} exceeded no-output timeout`);
246+return {
247+ ...result,
248+code: result.code || 143,
249+signal: null,
250+timing: null,
251+};
252+}
236253if (result.signal) {
237254console.error(`[test] ${spec.config} exited by signal ${result.signal}`);
238255releaseLockOnce();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。