chore: 加固 Gitea Release 上传,避免维护期丢资产
0.9.5 的 Release workflow 因 Gitea 服务端维护期不稳,5 个资产 上传 3 次重试全部失败,Gitea 侧只落地 7/12(已手动补齐)。 根因不是代码缺陷,但二进制变大后并发大文件上传放大了影响。 - job timeout-minutes: 30 → 60,给重试留足窗口。 - 单资产重试次数 3 → 5,间隔保持 3 秒。 - 上传从「2 并发 + wait」改为串行,维护期不再互相抢带宽; 幂等逻辑不变(已存在资产校验 SHA-256 后跳过,字节不同才删除重传)。 - 同步 release-validation.test.ts:断言改 attempt 2/5, 并发用例改为验证严格单 worker(peak === 1), 失败用例的 spawnSync 超时放宽到 40s。 校验:YAML parse 通过;bun test 1114 pass / 0 fail; bun run check、check:readme 37/37 全通过。 本次只改 CI,不打 tag、不发版。
This commit is contained in:
1 parent
f3caebfd8a
commit
bfbf6cf55f
2 files changed
+11
-19
No files matched your search
@@ -162,7 +162,7 @@ for arg in "$@"; do
|
||||
done
|
||||
exit 22
|
||||
`, { mode: 0o755 });
|
||||
const result = spawnSync("bash", ["-eo", "pipefail", "-c", step.run], { cwd: f.root, env: { ...process.env, PATH: `${join(f.root, "tools")}:${process.env.PATH}`, GITEA_TOKEN: "fixture", GITEA_RETRY_DELAY: "0", GITEA_HOST: "https://example.test", GITEA_REPO: "test/repo", RELEASE_TAG: "v1.0.0" }, encoding: "utf8", timeout: 30_000 });
|
||||
const result = spawnSync("bash", ["-eo", "pipefail", "-c", step.run], { cwd: f.root, env: { ...process.env, PATH: `${join(f.root, "tools")}:${process.env.PATH}`, GITEA_TOKEN: "fixture", GITEA_RETRY_DELAY: "0", GITEA_HOST: "https://example.test", GITEA_REPO: "test/repo", RELEASE_TAG: "v1.0.0" }, encoding: "utf8", timeout: 40_000 });
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stdout).toContain("assets failed to upload");
|
||||
expect(result.stdout).not.toContain("Successfully published");
|
||||
@@ -173,7 +173,7 @@ exit 22
|
||||
const result = f.run();
|
||||
expect(result.status).toBe(0);
|
||||
for (const name of f.files) expect(readFileSync(join(f.root, `count-${name}`), "utf8")).toBe("2");
|
||||
expect(result.stdout).toContain("attempt 2/3");
|
||||
expect(result.stdout).toContain("attempt 2/5");
|
||||
}, 60_000);
|
||||
|
||||
test("correct mirror assets are verified and retained without uploading replacements", () => {
|
||||
@@ -189,7 +189,7 @@ exit 22
|
||||
expect(readFileSync(join(f.root, "gh.log"), "utf8")).toContain("release download v1.0.0");
|
||||
}, 60_000);
|
||||
|
||||
test("asset transfers never exceed two concurrent workers", () => {
|
||||
test("asset transfers are serialized to a single worker", () => {
|
||||
const f = mirrorFixture("concurrency");
|
||||
expect(f.run().status).toBe(0);
|
||||
let active = 0, peak = 0;
|
||||
@@ -198,6 +198,6 @@ exit 22
|
||||
peak = Math.max(peak, active);
|
||||
}
|
||||
expect(active).toBe(0);
|
||||
expect(peak).toBeLessThanOrEqual(2);
|
||||
expect(peak).toBe(1);
|
||||
}, 60_000);
|
||||
});
|
||||
Reference in new issue
Block a user