@norskvideo/ctl-test-harness 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/daemon.d.ts +1 -0
- package/daemon.js +10 -1
- package/package.json +1 -1
package/daemon.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { pollUntil } from "./poll.js";
|
|
2
2
|
import { makeStoreDir, makeTempDir, TEST_TMP_BASE } from "./temp-dir.js";
|
|
3
3
|
export declare const HEALTH_TIMEOUT_MS = 120000;
|
|
4
|
+
export declare const DAEMON_READY_TIMEOUT_MS = 60000;
|
|
4
5
|
export { makeStoreDir, makeTempDir, pollUntil, TEST_TMP_BASE };
|
|
5
6
|
export declare function requireLicenseFile(): string;
|
|
6
7
|
export declare function runCli(storeDir: string, ...args: string[]): Promise<{
|
package/daemon.js
CHANGED
|
@@ -11,6 +11,15 @@ import { pollUntil } from "./poll.js";
|
|
|
11
11
|
import { makeStoreDir, makeTempDir, TEST_TMP_BASE } from "./temp-dir.js";
|
|
12
12
|
process.env.NORSK_CTL_NO_MEDIA_DOWNLOAD = "1";
|
|
13
13
|
export const HEALTH_TIMEOUT_MS = 120_000;
|
|
14
|
+
// The daemon's readiness probe (/api/ready) cannot answer until `serve` has
|
|
15
|
+
// brought up its oauth2-proxy + nginx sidecar CONTAINERS — /api/* redirects
|
|
16
|
+
// through the proxy. On a cold or contended CI runner that bring-up finishes
|
|
17
|
+
// just past 10s (observed ~10.5s on the GPU box under nightly load), so a 10s
|
|
18
|
+
// window lost the photo-finish and failed every test at setup with "Daemon did
|
|
19
|
+
// not become ready ... Unable to connect". A healthy daemon still answers in
|
|
20
|
+
// under a second, so the wider window only costs wall-clock when startup is
|
|
21
|
+
// genuinely slow.
|
|
22
|
+
export const DAEMON_READY_TIMEOUT_MS = 60_000;
|
|
14
23
|
export { makeStoreDir, makeTempDir, pollUntil, TEST_TMP_BASE };
|
|
15
24
|
function splitLines(text) {
|
|
16
25
|
return text
|
|
@@ -89,7 +98,7 @@ export function startDaemon(storeDir, options) {
|
|
|
89
98
|
const ready = pollUntil(async () => {
|
|
90
99
|
const res = await fetch(`http://localhost:${port}/api/ready`, { signal: AbortSignal.timeout(1000) });
|
|
91
100
|
return res.ok;
|
|
92
|
-
}, { timeoutMs:
|
|
101
|
+
}, { timeoutMs: DAEMON_READY_TIMEOUT_MS, intervalMs: 500, label: "Daemon did not become ready" });
|
|
93
102
|
return { daemon, ready };
|
|
94
103
|
}
|
|
95
104
|
function runningContainers(names) {
|