build(Makefile): limit duration of test runs
Sometimes I accidentally make a test that never finishes and uses all the CPU and memory available. Killing that manually can be impossible, because switching focus to the right terminal requires more CPU and memory than the kernel can spare.
Signed-off-by: Lars Wirzenius liw@liw.fi
fix: make reading child output not block forever, if there is none
Spawn a thread that sleeps until timeout, then notifies the RealtimeLines condition variable, which wakes up the reader thread and lets it eventually finish.
Signed-off-by: Lars Wirzenius liw@liw.fi
2 files changed
+46
-8
ac9261bb
→
b3898f65
modified Makefile
@@ -10,10 +10,10 @@ build:
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/timeoutcmd.rs
@@ -161,6 +161,9 @@ pub struct ChildProcess {
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -216,6 +219,16 @@ impl ChildProcess {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -228,6 +241,7 @@ impl ChildProcess {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -417,16 +431,25 @@ impl RealtimeLines {
|
|
|
|
|
|
| + | |
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -434,11 +457,13 @@ impl RealtimeLines {
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -680,7 +705,20 @@ mod tests {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|