From 67d965d560facf2233d572567b8db99b4febcb5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 16 Aug 2022 12:40:57 +0200 Subject: [PATCH] scripting: Exit helper after running test This avoids the helper process exiting with an error due to a broken pipe. Part-of: --- data/dbus-interfaces/org.gnome.Shell.PerfHelper.xml | 1 + js/ui/scripting.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/data/dbus-interfaces/org.gnome.Shell.PerfHelper.xml b/data/dbus-interfaces/org.gnome.Shell.PerfHelper.xml index 98fea27e9..140bbcc34 100644 --- a/data/dbus-interfaces/org.gnome.Shell.PerfHelper.xml +++ b/data/dbus-interfaces/org.gnome.Shell.PerfHelper.xml @@ -1,5 +1,6 @@ + diff --git a/js/ui/scripting.js b/js/ui/scripting.js index a4d80d749..76a74d5e8 100644 --- a/js/ui/scripting.js +++ b/js/ui/scripting.js @@ -284,6 +284,15 @@ async function _runPerfScript(scriptModule, outputFile) { log(`Script failed: ${err}\n${err.stack}`); Meta.exit(Meta.ExitCode.ERROR); } + + try { + const perfHelper = _getPerfHelper(); + perfHelper.ExitSync(); + } catch (err) { + log(`Failed to exit helper: ${err}\n${err.stack}`); + Meta.exit(Meta.ExitCode.ERROR); + } + Meta.exit(Meta.ExitCode.SUCCESS); }