mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 00:03:15 +01:00
test(flaky): the coordinator clone reads the fixture origin through git, not by copying its objects directory (GSTA-139)
Every push into the fixture origin leaves a detached 'git maintenance run --auto' there (local transport drops the shard's GIT_CONFIG_COUNT backstop), which creates and deletes objects/maintenance.lock after the push returns. A local clone copies origin.git/objects entry by entry, so an entry appearing or vanishing mid-copy fails it; --no-local never lists that directory. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
03f9bef6e6
commit
acbbd9f7f9
2 files changed
+19
-2
No files matched your search
@@ -98,10 +98,18 @@ export function ghQueueShim(repo: FixtureRepo, data: { prs: Record<string, unkno
|
||||
return { PATH: `${dir}:${process.env.PATH ?? ''}` };
|
||||
}
|
||||
|
||||
/** A coordinator's separate clone of the fixture origin. */
|
||||
/**
|
||||
* A coordinator's separate clone of the fixture origin, fetched through git's
|
||||
* transport (--no-local) like a real clone of GitHub. A local clone copies
|
||||
* origin.git/objects entry by entry, and every push into the fixture origin
|
||||
* leaves a detached `git maintenance run --auto` there that creates and
|
||||
* deletes objects/maintenance.lock after the push returns: local transport
|
||||
* drops the shard's GIT_CONFIG_COUNT maintenance-off backstop, so it never
|
||||
* reaches that receive-pack.
|
||||
*/
|
||||
export function coordinatorClone(repo: FixtureRepo): string {
|
||||
const dir = path.join(repo.root, 'coordinator');
|
||||
const r = spawnSync('git', ['clone', '-q', repo.origin, dir], { timeout: 60_000, env: { ...process.env, ...repo.env } });
|
||||
const r = spawnSync('git', ['clone', '-q', '--no-local', repo.origin, dir], { timeout: 60_000, env: { ...process.env, ...repo.env } });
|
||||
if (r.status !== 0) throw new Error(`clone failed: ${r.stderr?.toString()}`);
|
||||
return dir;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,15 @@ function publishMain(fx: TrainFixture, prefixCommit: string, version: string, ex
|
||||
return repo.git('rev-parse', 'HEAD');
|
||||
}
|
||||
|
||||
// fails_when=coordinatorClone copies origin.git/objects file by file again, so an entry that appears or vanishes there mid-copy (the detached maintenance.lock every push into the fixture origin leaves) fails the clone, as in Free Tests 40667144783 and 40691467553; why_new=no other test clones while origin's objects directory changes; seam=a dangling symlink planted under objects/, which a local copy refuses on every run; no_claim=which process removed the loose object those runs named
|
||||
test('the coordinator clone reads origin through git, never by copying its objects directory (GSTA-139)', () => {
|
||||
const fx = make();
|
||||
fs.symlinkSync(path.join(fx.repo.root, 'gone'), path.join(fx.repo.origin, 'objects', 'maintenance.lock'));
|
||||
const coord = coordinatorClone(fx.repo);
|
||||
expect(spawnSync('git', ['-C', coord, 'rev-parse', 'origin/main'], { encoding: 'utf8', timeout: 30_000, env: { ...process.env, ...fx.repo.env } }).stdout.trim()).toBe(fx.repo.git('rev-parse', 'origin/main'));
|
||||
expect(fs.existsSync(path.join(coord, '.git', 'objects', 'maintenance.lock'))).toBe(false);
|
||||
});
|
||||
|
||||
describe('the train command surface', () => {
|
||||
test('train with no subcommand (flags only) prints the train help and exits usage; --help exits 0; bad arguments name what is missing', () => {
|
||||
const fx = make();
|
||||
|
||||
Reference in new issue
Block a user