test(r): split the R rename fixtures across two files and run eleven platform shards

The 110 R rename fixtures run as one file that projects to about 1665 s on
Windows at 15 s per test, past the 1200 s shard watchdog. Run them as two files
of 55 fixtures (about 825 s each) so each fits a shard.

The helper keeps defineRenameFixtureTests(language) unchanged for every
language, except that it skips fixtures listed in renameOverflowIds (R only).
defineRenameOverflowFixtureTests(language) registers just those, from the new
rename-provider-r-part2.test.ts. The matrix test is untouched. Each file pins its
partition count, and the first file proves no overflow id names a missing
fixture.

Shard weights, the cross-platform file list and the coverage hints now include
the second file. Charging the second half adds 695 s to the Windows table, which
no longer fits ten shards under the two-minute headroom the shard unit test
requires (busiest shard 1133 s against a 1080 s ceiling). TOTAL in ci-tests.yml
goes from 10 to 11, giving a busiest shard of 1029 s.
This commit is contained in:
Mick Cooney 2026-10-25 11:13:05 +00:00
parent ab0a3acf13
commit fe759fbfbf
8 changed files with 141 additions and 13 deletions

View file

@ -196,8 +196,8 @@ jobs:
- id: gen
run: |
# Refreshed Windows timings leave eight shards too close to the
# 20-minute watchdog. Ten preserve headroom for runner variation.
TOTAL=10 # cross-platform (windows/macOS) shards per OS
# 20-minute watchdog. Eleven preserve headroom for runner variation.
TOTAL=11 # cross-platform (windows/macOS) shards per OS
# Four coverage shards exceeded the 25-minute job limit while tests
# were still passing. Split the full suite further; keep the timeout
# and merged coverage thresholds unchanged.

View file

@ -73,7 +73,10 @@ export const WINDOWS_WEIGHTS_SEC: Readonly<Record<string, number>> = {
// old 100 s entry let this file share shard 5/10 with go and dml-gate and
// exhaust the 20-minute watchdog. Weighted at the faster measurement, scaled by
// 55 fixtures + the pin test over the 49 + 1 measured (6 fixtures added since).
// 110 fixtures now run as two files of 55 (rename-provider-r and -r-part2),
// each weighted as that 55-fixture file: 695 s apiece, so the packer places them apart.
'test/integration/rename-provider-r.test.ts': 695,
'test/integration/rename-provider-r-part2.test.ts': 695,
'test/integration/rename-provider-ruby.test.ts': 100,
'test/integration/rename-provider-rust.test.ts': 75,
'test/integration/rename-provider-swift.test.ts': 300,

View file

@ -181,6 +181,7 @@ const LBUG_NATIVE = [
'test/integration/rename-provider-php.test.ts',
'test/integration/rename-provider-python.test.ts',
'test/integration/rename-provider-r.test.ts',
'test/integration/rename-provider-r-part2.test.ts',
'test/integration/rename-provider-ruby.test.ts',
'test/integration/rename-provider-rust.test.ts',
'test/integration/rename-provider-swift.test.ts',

View file

@ -36,10 +36,87 @@ for (const language of (await fs.readdir(fixtures, { withFileTypes: true })).fil
renameCases.sort((left, right) => (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
// A language whose fixtures outgrow one CI shard budget moves part of them into an overflow file.
// The ids listed here are skipped by `defineRenameFixtureTests` and run only through
// `defineRenameOverflowFixtureTests`, so every fixture is registered exactly once. Keyed by id,
// so a fixture added later stays in the primary file until it is listed.
export const renameOverflowIds: ReadonlySet<string> = new Set([
'r/assign-local-conditional',
'r/assign-local-constant-call',
'r/assign-local-function-literal-no-call',
'r/assign-local-nested-function',
'r/assign-local-no-call',
'r/backtick-definition',
'r/chained-receiver-same-name',
'r/collision-new-name-parameter-call',
'r/collision-unrelated-uses',
'r/collision-variable-before',
'r/cross-file-qualified-call',
'r/duplicate-definition-other-file',
'r/duplicate-definition-test-stub',
'r/export-name-null',
'r/function-call-chain',
'r/generated-cpp11-wrapper',
'r/infix-operator',
'r/invalid-name-invalid-start',
'r/local-def-call-before',
'r/local-def-first',
'r/local-def-loop',
'r/namespace-export',
'r/namespace-export-new-name',
'r/namespace-pattern-new-name-exported',
'r/namespace-pattern-word-boundary',
'r/namespace-private-external-call',
'r/namespace-private-local-import',
'r/newname-pretty-dot',
'r/parameter-body-read',
'r/parameter-constant-default-call-and-read',
'r/parameter-no-default-call',
'r/r6-class',
'r/r6-member-shadow-private',
'r/r6-method',
'r/rawnamespace-attached',
'r/rc-own-method-shadow',
'r/refclass-parent-without-member',
'r/replacement-getter',
'r/replacement-setter',
'r/rprofile-mention',
'r/s3-method',
'r/s3-new-method-dotted-generic',
'r/s3-new-method-name',
'r/s4-class',
'r/self-method-same-name',
'r/string-built-name',
'r/string-glue-call',
'r/string-lookup-escaped',
'r/string-parse-text',
'r/superassign-in-function',
'r/toplevel-call-before-definition-attached',
'r/unindexed-no-mention',
'r/unparseable-other-file',
'r/value-reference-default',
'r/value-reference-function-argument',
]);
// Separate files let CI distribute these real indexing runs across its shards.
export function defineRenameFixtureTests(language: string): void {
defineRenameFixtureCases(
(fixture) => fixture.language === language && !renameOverflowIds.has(fixture.id),
);
}
// Registers only the overflow fixtures of `language`, for its second test file.
export function defineRenameOverflowFixtureTests(language: string): void {
defineRenameFixtureCases(
(fixture) => fixture.language === language && renameOverflowIds.has(fixture.id),
);
}
function defineRenameFixtureCases(
include: (fixture: (typeof renameCases)[number]) => boolean,
): void {
describe('persisted semantic rename across providers (no mocks)', () => {
it.each(renameCases.filter((fixture) => fixture.language === language))(
it.each(renameCases.filter(include))(
'$id',
async ({ directory }) => {
const temporary = await fs.mkdtemp(path.join(os.tmpdir(), 'rename-integration-'));

View file

@ -24,6 +24,8 @@ const SEQUENTIAL_COVERAGE_SECONDS: Readonly<Record<string, number>> = {
'test/integration/rename-provider-kotlin.test.ts': 93,
'test/integration/rename-provider-objective-c.test.ts': 82,
'test/integration/rename-provider-python.test.ts': 91,
'test/integration/rename-provider-r-part2.test.ts': 122,
'test/integration/rename-provider-r.test.ts': 120,
'test/integration/rename-provider-swift.test.ts': 72,
'test/integration/rename-provider-typescript.test.ts': 173,
'test/integration/rename-provider-vue.test.ts': 48,

View file

@ -0,0 +1,19 @@
import { describe, expect, it } from 'vitest';
import {
defineRenameOverflowFixtureTests,
renameCases,
renameOverflowIds,
} from '../helpers/rename-integration-cases.js';
// Second half of the R rename fixtures, split out to fit the Windows shard budget; the first half
// and the partition pins live in rename-provider-r.test.ts.
describe('R rename overflow fixtures', () => {
it('are all discovered', () => {
const overflow = renameCases.filter(
(fixture) => fixture.language === 'r' && renameOverflowIds.has(fixture.id),
);
expect(overflow).toHaveLength(55);
});
});
defineRenameOverflowFixtureTests('r');

View file

@ -1,12 +1,29 @@
import { describe, expect, it } from 'vitest';
import { defineRenameFixtureTests, renameCases } from '../helpers/rename-integration-cases.js';
import {
defineRenameFixtureTests,
renameCases,
renameOverflowIds,
} from '../helpers/rename-integration-cases.js';
// The fixture runner builds its test list from the directory, so an empty or renamed directory
// would define no test and stay green. Pin the number of R cases: adding one means raising it.
// The Windows shard budget holds about half of them, so the overflow ids run from
// rename-provider-r-part2.test.ts; the two counts below must add up to the pin.
describe('R rename fixtures', () => {
it('are all discovered', () => {
expect(renameCases.filter((fixture) => fixture.language === 'r')).toHaveLength(110);
});
it('split exactly between this file and the overflow file', () => {
const ids = renameCases.filter((fixture) => fixture.language === 'r').map((f) => f.id);
const overflow = ids.filter((id) => renameOverflowIds.has(id));
expect(overflow).toHaveLength(55);
expect(ids.length - overflow.length).toBe(55);
// An overflow id naming no R fixture would silently shrink the second file.
expect([...renameOverflowIds].filter((id) => id.startsWith('r/') && !ids.includes(id))).toEqual(
[],
);
});
});
defineRenameFixtureTests('r');

View file

@ -100,18 +100,26 @@ describe('cross-platform shard partition', () => {
).toEqual([]);
});
it('keeps the R rename suite off the shards that hold the go and dml-gate suites', () => {
it('keeps the R rename suites off the shards that hold the go and dml-gate suites', () => {
// Windows CI run, 2026-10-17: rename-provider-r (599-750 s measured, 49
// persisted fixtures) was charged 100 s, so the packer put it with go and
// dml-gate and the shard exhausted the 20-minute watchdog.
const rWeight = weightOf('test/integration/rename-provider-r.test.ts');
expect(rWeight).toBeGreaterThanOrEqual(600);
// dml-gate and the shard exhausted the 20-minute watchdog. The 110 R fixtures
// now run as two files of 55, each charged like that 55-fixture file.
const halves = [
'test/integration/rename-provider-r.test.ts',
'test/integration/rename-provider-r-part2.test.ts',
];
const shards = allShards(ALL_CROSS_PLATFORM, SHARD_TOTAL);
const shardOf = (file: string) => shards.findIndex((files) => files.includes(file));
const r = shardOf('test/integration/rename-provider-r.test.ts');
expect(r).not.toBe(-1);
expect(shardOf('test/integration/rename-provider-go.test.ts')).not.toBe(r);
expect(shardOf('test/unit/incremental-index-extension-dml-gate.test.ts')).not.toBe(r);
for (const half of halves) {
expect(weightOf(half)).toBeGreaterThanOrEqual(600);
const r = shardOf(half);
expect(r).not.toBe(-1);
expect(shardOf('test/integration/rename-provider-go.test.ts')).not.toBe(r);
expect(shardOf('test/unit/incremental-index-extension-dml-gate.test.ts')).not.toBe(r);
}
// Both halves on one shard would project past the 1200 s watchdog at 15 s/test.
expect(shardOf(halves[0])).not.toBe(shardOf(halves[1]));
});
it('covers every file exactly once, with no overlap between shards', () => {
@ -147,7 +155,8 @@ describe('cross-platform shard partition', () => {
// fitting under 20 minutes left the previous partition prone to timeout.
// The ceiling was 17 minutes until the R rename provider suite (measured
// ~600 s on Windows) was charged its real weight: the table total grew by
// ~520 s, so even a perfect ten-way split averages ~1047 s per shard.
// ~520 s, so even a perfect ten-way split averages ~1047 s per shard; the 695 s added by splitting the R
// suite into two files made it eleven shards.
expect(Math.max(...loads)).toBeLessThanOrEqual(18 * 60);
});