@@ -44,6 +44,12 @@ def run_with_logging(dockercall, cmd, logger, printlog=True):
44
44
# save command to log
45
45
logger .info ("++ " + cmdstr + "\n " )
46
46
pipe = subprocess .Popen (shlex .split (cmdstr ), stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
47
+
48
+ # Maximum number of seconds to wait for "docker run" to finish after
49
+ # its child process exits. The observed times have been < 1 ms.
50
+ # Use a relatively large number to flag a possible problem with Docker.
51
+ timeout = 10
52
+
47
53
with pipe .stdout :
48
54
for line in iter (pipe .stdout .readline , b'' ): # b'\n'-separated lines
49
55
decoded = line .decode ("utf-8" )
@@ -52,6 +58,9 @@ def run_with_logging(dockercall, cmd, logger, printlog=True):
52
58
decoded = decoded [:- 1 ]
53
59
logger .info (decoded )
54
60
ret = pipe .poll ()
61
+ if ret is None :
62
+ ret = pipe .wait (timeout = timeout )
63
+ # ret will be None if exception TimeoutExpired was raised and caught.
55
64
if ret != 0 :
56
65
raise subprocess .CalledProcessError (ret , cmdstr )
57
66
@@ -670,10 +679,7 @@ def prdocs(self):
670
679
671
680
def tartests (self ):
672
681
"""
673
- Tar up test directories for delivery. PGE has requested that
674
- the scratch directory contents be excluded from the deliveries.
675
- Include the scratch directories only as empty directories to
676
- maintain consistency with the runconfigs.
682
+ Tar up test directories for delivery
677
683
"""
678
684
for workflow in workflowtests :
679
685
for test in workflowtests [workflow ]:
0 commit comments