Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(devices): retain inventory when AVD enumeration fails #19974

MergedQuicksaver(GitHub profile, opens in a new tab)merged 9 commits intomain fromrefs/pull/19974/headmerged by juliusmarminge View on GitHub

Showing 8 changed files with 129 additions and 21 deletions (loading 5).

x
0 of 8 viewed, 8 left
77 additions and 0 deletionsapps/server/src/device/DeviceService.test.tsModified
View file
@@ -842,6 +842,83 @@
}).pipe(Effect.provide(ServerSettings.layerTest({ enableDeviceSupport: true })), Effect.scoped),
​
+it.effect.each([LOCAL_DEVICE_HOST_ID, "ssh-fixture"])(
+ "retains hub inventory on %s when AVD enumeration fails and recovers on retry",
+ (hostId) =>
+ Effect.gen(function* () {
+ let enumeration = { code: 1, stdout: "private stdout", stderr: "private stderr" };
+ const ready: DeviceHost.DeviceHostReady = {
+ nodePath: process.execPath,
+ hub: { origin: "http://device.test" },
+ helpers: { serveSimAxSettings: null, serveSimCli: null },
+ run: () => Effect.sync(() => enumeration),
+ };
+ const host: DeviceHost.DeviceHost["Service"] = {
+ id: hostId,
+ summary: Effect.succeed({
+ id: hostId,
+ kind: hostId === LOCAL_DEVICE_HOST_ID ? "local" : "ssh",
+ label: "Test device host",
+ platforms: [{ platform: "android", available: true }],
+ hubInstalled: true,
+ agentDeviceInstalled: false,
+ }),
+ platformAvailability: (platform) => Effect.succeed({ platform, available: true }),
+ ensureReady: () => Effect.succeed(ready),
+ ensureAgentReady: () => Effect.die("Agent access is not used in this test"),
+ current: Effect.succeed(ready),
+ stop: Effect.void,