[PATCH] Add per-test timeouts to lit

Jonathan Roelofs jonathan at codesourcery.com
Thu May 28 09:25:14 PDT 2015

> Leading question: If a shell command guarded by a Watchdog exits scope via an exception should Watchdog.cancel() be called?

I think in this case, the watchdog should kill all the processes it was watching.

> I think the Watchdog should provide a factory function that can be used in a with statement.

Oooh, I like it.

Comment at: utils/lit/lit/util.py:35
@@ +34,3 @@
+    def _handler(self):
+        with self._lock:
EricWF wrote:
> I'm not sure if this matters, but I want to clarify what is considered a "timeout failure". For example, what if the timers invokes the handler but every open process has already finished? Should this be considered a timeout?
I consider a "timeout failure" to happen when the timer runs out //before// `cancel()` is called, regardless of whether the handler had to kill anything.

Comment at: utils/lit/lit/util.py:226
@@ -169,1 +225,3 @@
+    if timeout is not None:
+        wd.cancel()
EricWF wrote:
> Should this call to cancel be exception safe? 
'exception safe' in what sense... do you expect the timer cancellation to throw?

or did you mean 'thread safe'?



More information about the llvm-commits mailing list