[ARVADOS] updated: 1.1.3-216-gea8013a

Git user git at public.curoverse.com
Tue Mar 20 13:43:45 EDT 2018


Summary of changes:
 sdk/python/tests/test_arv_put.py | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

       via  ea8013a2d0cd0faeeec132f5d950fb3a5461d6ca (commit)
      from  247f218e49da73cfcd5b27a4990f16e3a3231ddd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit ea8013a2d0cd0faeeec132f5d950fb3a5461d6ca
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Mar 20 13:39:49 2018 -0400

    12167: Stop waiting for arv-put to start up when logs appear.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py
index 0ad6323..4b1f694 100644
--- a/sdk/python/tests/test_arv_put.py
+++ b/sdk/python/tests/test_arv_put.py
@@ -18,12 +18,12 @@ import os
 import pwd
 import random
 import re
+import select
 import shutil
 import signal
 import subprocess
 import sys
 import tempfile
-import threading
 import time
 import unittest
 import uuid
@@ -859,16 +859,18 @@ class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
                       pipe.stdout.read().decode())
 
     def test_sigint_logs_request_id(self):
-        # Connect 'yes' command output to arv-put, wait for a second and
-        # send SIGINT to arv-put's process, then check if its output includes
-        # the X-Request-Id.
+        # Start arv-put, give it a chance to start up, send SIGINT,
+        # and check that its output includes the X-Request-Id.
         input_stream = subprocess.Popen(
-            'yes', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+            ['sleep', '10'],
+            stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
         pipe = subprocess.Popen(
             [sys.executable, arv_put.__file__, '--stream'],
             stdin=input_stream.stdout, stdout=subprocess.PIPE,
             stderr=subprocess.STDOUT, env=self.ENVIRON)
-        time.sleep(1)
+        # Wait for arv-put child process to print something (i.e., a
+        # log message) so we know its signal handler is installed.
+        select.select([pipe.stdout], [], [], 10)
         pipe.send_signal(signal.SIGINT)
         deadline = time.time() + 5
         while (pipe.poll() is None) and (time.time() < deadline):
@@ -877,7 +879,7 @@ class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
         input_stream.terminate()
         if returncode is None:
             pipe.terminate()
-            self.fail("arv-put did not exited within 5 seconds")
+            self.fail("arv-put did not exit within 5 seconds")
         self.assertRegex(pipe.stdout.read().decode(), r'\(X-Request-Id: req-[a-z0-9]{20}\)')
 
     def test_ArvPutSignedManifest(self):

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list