+ self.maxIndividualTestTime = maxIndividualTestTime
+
+ @property
+ def maxIndividualTestTime(self):
+ """
+ Interface for getting maximum time to spend executing
+ a single test
+ """
+ return self._maxIndividualTestTime
+
+ @maxIndividualTestTime.setter
+ def maxIndividualTestTime(self, value):
+ """
+ Interface for setting maximum time to spend executing
+ a single test
+ """
+ self._maxIndividualTestTime = value
+ if self.maxIndividualTestTime > 0:
+ # The current implementation needs psutil to set
+ # a timeout per test. Check it's available.
+ # See lit.util.killProcessAndChildren()
+ try:
+ import psutil
+ except ImportError:
+ self.fatal("Setting a timeout per test requires the"
+ " Python psutil module but it could not be"
+ " found. Try installing it via pip or via"
+ " your operating system's package manager.")
+ elif self.maxIndividualTestTime < 0:
+ self.fatal('The timeout per test must be >= 0 seconds')