Skip to content

Commit 537ae6e

Browse files
test: give the corpus groups a 10 minute bound and write the report from every shard
1 parent c33674d commit 537ae6e

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎test/specCases/minify-corpora.js‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const swcTestsDir = path.join(
4545
const oxcTestsDir = path.join(externalDir, "oxc/crates/oxc_minifier/tests");
4646

4747
// A group minifies each of its sources once per option set, with both minifiers.
48-
const GROUP_TIMEOUT = 300000;
48+
const GROUP_TIMEOUT = 600000;
4949

5050
/**
5151
* An option value, copied so neither minifier sees what the other wrote into
@@ -2261,9 +2261,7 @@ module.exports = (shard, count) => {
22612261
const done = fs
22622262
.readdirSync(runDir)
22632263
.filter((name) => name.endsWith(".json"));
2264-
// Run alone, a shard cannot tell which entries the others meet.
2265-
if (done.length < count) return;
2266-
let complete = true;
2264+
let complete = done.length === count;
22672265
/** @type {Lead[]} */
22682266
const allLeads = [];
22692267
/** @type {Record<string, string[]>} */
@@ -2280,9 +2278,13 @@ module.exports = (shard, count) => {
22802278
);
22812279
}
22822280
}
2283-
fs.rmSync(runDir, { recursive: true, force: true });
2281+
// Rewritten by every shard, as a filter can leave a shard with no test to run.
22842282
const report = process.env.JS_MINIFY_REPORT;
22852283
if (report) fs.writeFileSync(report, formatLeads(allLeads));
2284+
if (done.length === count) {
2285+
fs.rmSync(runDir, { recursive: true, force: true });
2286+
}
2287+
// Run alone or filtered, a shard cannot tell which entries the others meet.
22862288
const stale = complete ? staleEntries(seen) : [];
22872289
if (stale.length > 0) {
22882290
throw new Error(

0 commit comments

Comments
 (0)