Skip to content

Commit dbc306d

Browse files
authored
Merge pull request #420 from bcorfman/lfsfix
Use git lfs install --skip repo + fix race cond in Node unit tests
2 parents e7a70ad + b18e3b7 commit dbc306d

4 files changed

Lines changed: 31 additions & 7 deletions

File tree

.github/workflows/ci-build-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Ensure Git LFS assets are present
3333
run: |
34-
git lfs install
34+
git lfs install --skip-repo
3535
git lfs pull
3636
git lfs checkout
3737
@@ -59,7 +59,7 @@ jobs:
5959
6060
- name: Ensure Git LFS assets are present
6161
run: |
62-
git lfs install
62+
git lfs install --skip-repo
6363
git lfs pull
6464
git lfs checkout
6565
@@ -87,7 +87,7 @@ jobs:
8787
8888
- name: Ensure Git LFS assets are present
8989
run: |
90-
git lfs install
90+
git lfs install --skip-repo
9191
git lfs pull
9292
git lfs checkout
9393
@@ -115,7 +115,7 @@ jobs:
115115
116116
- name: Ensure Git LFS assets are present
117117
run: |
118-
git lfs install
118+
git lfs install --skip-repo
119119
git lfs pull
120120
git lfs checkout
121121

.github/workflows/deploy-frontend-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Ensure Git LFS assets are present
4747
run: |
48-
git lfs install
48+
git lfs install --skip-repo
4949
git lfs pull
5050
git lfs checkout
5151

.github/workflows/e2e-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
3737
- name: Ensure Git LFS assets are present
3838
run: |
39-
git lfs install
39+
git lfs install --skip-repo
4040
git lfs pull
4141
git lfs checkout
4242

scripts/e2e-external-webserver.cjs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,27 @@ async function waitForPort(host, port, timeoutMs) {
6767
throw new Error(`Timed out waiting for ${host}:${port}`);
6868
}
6969

70+
async function waitForManagedServerReadiness({ host, port, timeoutMs, child, logDir }) {
71+
const deadline = Date.now() + timeoutMs;
72+
while (Date.now() < deadline) {
73+
if (child.exitCode != null || child.signalCode != null) {
74+
throw createManagedServerError(
75+
`Managed E2E web server exited before ready (code=${child.exitCode ?? 'null'}, signal=${child.signalCode ?? 'null'})`,
76+
logDir,
77+
);
78+
}
79+
if (await isPortOpen(host, port)) return;
80+
await new Promise((resolve) => setTimeout(resolve, 100));
81+
}
82+
if (child.exitCode != null || child.signalCode != null) {
83+
throw createManagedServerError(
84+
`Managed E2E web server exited before ready (code=${child.exitCode ?? 'null'}, signal=${child.signalCode ?? 'null'})`,
85+
logDir,
86+
);
87+
}
88+
throw new Error(`Timed out waiting for ${host}:${port}`);
89+
}
90+
7091
async function ensureCleanLogDir(logDir) {
7192
await fsp.rm(logDir, { recursive: true, force: true });
7293
await fsp.mkdir(logDir, { recursive: true });
@@ -199,7 +220,10 @@ async function startManagedExternalWebServer({
199220
});
200221

201222
try {
202-
await Promise.race([waitForPort(host, port, timeoutMs), unexpectedExit]);
223+
await Promise.race([
224+
waitForManagedServerReadiness({ host, port, timeoutMs, child, logDir }),
225+
unexpectedExit,
226+
]);
203227
} catch (error) {
204228
cleanup();
205229
throw error;

0 commit comments

Comments
 (0)