scripting: Exit helper after running test

This avoids the helper process exiting with an error due to a broken
pipe.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
This commit is contained in:
Jonas Ådahl 2022-08-16 12:40:57 +02:00
parent 6fc538b7f7
commit 67d965d560
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
<node> <node>
<interface name="org.gnome.Shell.PerfHelper"> <interface name="org.gnome.Shell.PerfHelper">
<method name="Exit"/>
<method name="CreateWindow"> <method name="CreateWindow">
<arg type="i" direction="in"/> <arg type="i" direction="in"/>
<arg type="i" direction="in"/> <arg type="i" direction="in"/>

View File

@ -284,6 +284,15 @@ async function _runPerfScript(scriptModule, outputFile) {
log(`Script failed: ${err}\n${err.stack}`); log(`Script failed: ${err}\n${err.stack}`);
Meta.exit(Meta.ExitCode.ERROR); 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); Meta.exit(Meta.ExitCode.SUCCESS);
} }