validate/baseclasses: Release un-needed data when test ends

This was keeping around 500-700kB of data for each test, which was
gradually raising memory usage of a full run by 100MB+

The reports are definitely not needed, and we only need to keep
information from the subprocess env variable that we might need
later on for final reporting
This commit is contained in:
Edward Hervey 2017-12-18 10:51:05 +01:00 committed by Edward Hervey
parent cb04515cbd
commit d71d28523d

View file

@ -519,6 +519,16 @@ class Test(Loggable):
if self.result is not Result.PASSED:
self._dump_log_files()
# Only keep around env variables we need later
clean_env = {}
for n in self.__env_variable:
clean_env[n] = self.proc_env.get(n, None)
self.proc_env = clean_env
# Don't keep around JSON report objects, they were processed
# in check_results already
self.reports = []
return self.result
class GstValidateTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):