diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-lite b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-lite index 5d3a40fc93..a9b8ba5cb8 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-lite +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-lite @@ -413,10 +413,9 @@ class Actions: """Undo a held intervention; targets whose undo failed stay held for the next restore.""" present = {t.get("id") for t in targets} mine = [t for t in targets if t.get("id") in held] - out = self.each(mine, method, params) - for target in mine: - if isinstance(out.get(target.get("title") or "?"), int): - held.discard(target.get("id")) + undone = set() + out = self.each(mine, method, params, undone) + held.difference_update(undone) held.intersection_update(present) return out diff --git a/tools/steam_lite_bench.py b/tools/steam_lite_bench.py index b624167c30..840ce0ea20 100644 --- a/tools/steam_lite_bench.py +++ b/tools/steam_lite_bench.py @@ -247,7 +247,7 @@ def system_available(dev: Device) -> int | None: return int(parts[1]) // 1024 if len(parts) >= 2 and parts[1].isdigit() else None -def oom_trial(dev: Device, app: str, profile: str, run_dir: Path, args) -> dict: +def oom_trial(dev: Device, app: str, profile: str, run_dir: Path, args, arm: str | None = None) -> dict: """Fresh Steam, launch, load the save, and see whether the session survives.""" run_dir.mkdir(parents=True, exist_ok=True) ensure_steam(dev, fresh=True) @@ -259,7 +259,7 @@ def oom_trial(dev: Device, app: str, profile: str, run_dir: Path, args) -> dict: total = args.idle + 60 + args.title + 10 + args.watch + 20 rec = recorder(dev, total, args.interval, name) events = {"profile": profile, "app": app, "started": time.time(), "kind": "oom", "env": args.env or [], - "arm": args.arm or profile} + "arm": arm or profile} time.sleep(args.idle) dev.mark("launch") t0 = time.monotonic() @@ -808,7 +808,7 @@ def main(argv=None) -> int: if args.arm and not arms and len(names) > 1: arm = "%s-%s" % (args.arm, name) run_dir = args.out / ("oom-%s-%s-r%d" % (args.app, arm, i + 1)) - events = oom_trial(dev, args.app, profile, run_dir, args) + events = oom_trial(dev, args.app, profile, run_dir, args, arm) print(json.dumps({k: events.get(k) for k in ("arm", "profile", "loaded", "survived", "died_after_s", "exit", "launch_s")}), flush=True) else: diff --git a/tools/tests/test_steam_lite.py b/tools/tests/test_steam_lite.py index d3eb30a4c1..eb72926475 100644 --- a/tools/tests/test_steam_lite.py +++ b/tools/tests/test_steam_lite.py @@ -218,6 +218,24 @@ class ActionsTest(unittest.TestCase): self.assertEqual(actions.frozen, {'w'}) self.assertTrue(actions.holding()) + def test_undo_results_follow_target_ids_when_titles_repeat(self): + log = [] + first = dict(STORE, id='w1') + second = dict(STORE, id='w2', webSocketDebuggerUrl='ws://127.0.0.1:8080/devtools/page/w2') + c = client(log, broken=()) + failing = c.opener + + def opener(url): + session = failing(url) + if url.endswith('/w'): + session.broken = ('Page.setWebLifecycleState',) + return session + c.opener = opener + actions = Actions(c, clock=lambda: 0.0) + actions.frozen = {'w1', 'w2'} + actions.thaw([first, second]) + self.assertEqual(actions.frozen, {'w1'}) + def test_a_closed_target_is_no_longer_held(self): self.actions.frozen = {'gone'} self.actions.thaw(TARGETS)