@expo/simulator-launcher 27.4.0 → 27.4.1
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/dist/index.js +43 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -15,13 +15,54 @@ async function claimAsync(bootUuid, engine, requestedDevice) {
|
|
|
15
15
|
if (!input.success) {
|
|
16
16
|
throw new Error(`Invalid Simulator session request. Choose ${state_1.ClaimInputSchema.shape.engine.options.join(', ')} and an optional device name or UDID.`);
|
|
17
17
|
}
|
|
18
|
+
// Startup and handoff share the worker's existing claim timeout.
|
|
19
|
+
const startedAt = Date.now();
|
|
20
|
+
const deadline = startedAt + 420_000;
|
|
21
|
+
let lastWaitLogAt;
|
|
22
|
+
let controller;
|
|
23
|
+
const ready = await (0, state_1.waitForLauncherStateAsync)(bootUuid, state => {
|
|
24
|
+
if (state?.status === 'stopping' || state?.status === 'disabled' || state?.error) {
|
|
25
|
+
throw new Error(`Simulator preparation was interrupted; cleanup may still be running.${state.error ? ` ${state.error}` : ''}`);
|
|
26
|
+
}
|
|
27
|
+
if (!state ||
|
|
28
|
+
(state.status !== 'starting' && state.status !== 'ready') ||
|
|
29
|
+
state.controllerPid === undefined) {
|
|
30
|
+
throw new Error('No warm Simulator session is available to claim on this VM.');
|
|
31
|
+
}
|
|
32
|
+
if (controller &&
|
|
33
|
+
(state.controllerPid !== controller.controllerPid ||
|
|
34
|
+
(controller.controllerStartTime !== undefined &&
|
|
35
|
+
state.controllerStartTime !== controller.controllerStartTime))) {
|
|
36
|
+
throw new Error('The Simulator launcher returned a different session or engine.');
|
|
37
|
+
}
|
|
38
|
+
controller = state;
|
|
39
|
+
if (state.status === 'starting') {
|
|
40
|
+
const now = Date.now();
|
|
41
|
+
if (lastWaitLogAt === undefined || now - lastWaitLogAt >= 30_000) {
|
|
42
|
+
process.stderr.write(`Warm Simulator is still starting; waiting (${Math.floor((now - startedAt) / 1_000)}s elapsed, 420s limit).\n`);
|
|
43
|
+
lastWaitLogAt = now;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return state.status === 'ready';
|
|
47
|
+
}, deadline - Date.now());
|
|
48
|
+
const prepared = state_1.WarmSessionInfoSchema.parse(ready);
|
|
18
49
|
const acquired = await (0, state_1.updateLauncherStateAsync)(bootUuid, state => {
|
|
19
50
|
if (state?.status !== 'ready') {
|
|
20
51
|
throw new Error('No warm Simulator session is available to claim on this VM.');
|
|
21
52
|
}
|
|
53
|
+
if (state.controllerPid !== prepared.controllerPid ||
|
|
54
|
+
state.controllerStartTime !== prepared.controllerStartTime) {
|
|
55
|
+
throw new Error('The Simulator launcher returned a different session or engine.');
|
|
56
|
+
}
|
|
57
|
+
if (Date.now() >= deadline) {
|
|
58
|
+
throw new Error('Timed out waiting for the Simulator launcher; cleanup may still be running.');
|
|
59
|
+
}
|
|
22
60
|
state_1.WarmSessionInfoSchema.parse(state);
|
|
23
61
|
return { ...state, ...input.data, status: 'claiming' };
|
|
24
62
|
});
|
|
63
|
+
if (lastWaitLogAt !== undefined) {
|
|
64
|
+
process.stderr.write(`Warm Simulator became ready after waiting ${Math.floor((Date.now() - startedAt) / 1_000)}s.\n`);
|
|
65
|
+
}
|
|
25
66
|
const claimed = await (0, state_1.waitForLauncherStateAsync)(bootUuid, state => {
|
|
26
67
|
if (!state || state.status === 'stopping' || state.status === 'disabled') {
|
|
27
68
|
throw new Error(`Simulator preparation was interrupted; cleanup may still be running.${state?.error ? ` ${state.error}` : ''}`);
|
|
@@ -32,7 +73,7 @@ async function claimAsync(bootUuid, engine, requestedDevice) {
|
|
|
32
73
|
throw new Error('The Simulator launcher returned a different session or engine.');
|
|
33
74
|
}
|
|
34
75
|
return state.status === 'claimed';
|
|
35
|
-
},
|
|
76
|
+
}, Math.max(0, deadline - Date.now()));
|
|
36
77
|
const { device } = state_1.WarmSessionInfoSchema.parse(claimed);
|
|
37
78
|
if (requestedDevice &&
|
|
38
79
|
device.name !== requestedDevice &&
|
|
@@ -18077,7 +18118,7 @@ module.exports = exports.default;
|
|
|
18077
18118
|
/***/ 8330:
|
|
18078
18119
|
/***/ ((module) => {
|
|
18079
18120
|
|
|
18080
|
-
module.exports = {"rE":"27.4.
|
|
18121
|
+
module.exports = {"rE":"27.4.1"};
|
|
18081
18122
|
|
|
18082
18123
|
/***/ })
|
|
18083
18124
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/simulator-launcher",
|
|
3
|
-
"version": "27.4.
|
|
3
|
+
"version": "27.4.1",
|
|
4
4
|
"description": "Launch and claim Simulator sessions on EAS workers",
|
|
5
5
|
"bugs": "https://github.com/expo/eas-cli/issues",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
35
|
"zod": "^4.3.5"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "3263ecfa369459437d7b5180564a796192f1189a"
|
|
38
38
|
}
|