[lit] Fix the --max-time flag feature which was completely broken.
For both the multiprocess mode and in-process sequential mode using
--max-time didn't work. For the former calling a.successful(),
when the result was not ready would lead an exception being raised.
For the latter max_time was being completely ignored.
Two test cases have been added which test this basic functionality.
This implementation is for from ideal
- For the multiprocess mode, tests that started executing but didn't finish are marked as UNRESOLVED. In reality they should really be marked as TIMEOUT.
- For the single process mode lit's per test timeout feature has been used as a hacky way to make sure --max-time is properly enforced. This feature currently requires the python psutil module to be installed, so --max-time and --single-process used together now requires the python psutil module to be installed.
If you are running the tests in process, there is no need to use this global child_lit_config. It is only needed so that mulitprocessing can pickle the data and set it up in the child process. We should be able to update self.lit_confi.maxIndividualTest time directly, and it will take effect.