You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ko...@apache.org on 2019/11/01 01:33:54 UTC

[avro] branch master updated: AVRO-2603: Check Exit Status of Tether Tool Command (#693)

This is an automated email from the ASF dual-hosted git repository.

kojiromike pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new eb3f51e  AVRO-2603: Check Exit Status of Tether Tool Command (#693)
eb3f51e is described below

commit eb3f51e7b5c9f87ed5fa9a6a10dd88cd5ec62faf
Author: Michael A. Smith <mi...@smith-li.com>
AuthorDate: Thu Oct 31 21:33:47 2019 -0400

    AVRO-2603: Check Exit Status of Tether Tool Command (#693)
---
 lang/py/test/test_tether_word_count.py | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/lang/py/test/test_tether_word_count.py b/lang/py/test/test_tether_word_count.py
index 355621f..9543ff2 100644
--- a/lang/py/test/test_tether_word_count.py
+++ b/lang/py/test/test_tether_word_count.py
@@ -92,9 +92,7 @@ class TestTetherWordCount(unittest.TestCase):
 
     Assumptions: 1) bash is available in /bin/bash
     """
-    proc=None
     exfile = None
-
     try:
       # TODO we use the tempfile module to generate random names
       # for the files
@@ -141,9 +139,6 @@ class TestTetherWordCount(unittest.TestCase):
       args.extend(["--outschema",outschema])
       args.extend(["--protocol","http"])
 
-      # form the arguments for the subprocess
-      subargs=[]
-
       srcfile = avro.tether.tether_task_runner.__file__
 
       # Create a shell script to act as the program we want to execute
@@ -172,10 +167,7 @@ python -m avro.tether.tether_task_runner word_count_task.WordCountTask
       args.extend(["--program",exfile])
 
       print("Command:\n\t{0}".format(" ".join(args)))
-      proc=subprocess.Popen(args)
-
-
-      proc.wait()
+      subprocess.check_call(args)
 
       # read the output
       datum_reader = avro.io.DatumReader()
@@ -184,9 +176,6 @@ python -m avro.tether.tether_task_runner word_count_task.WordCountTask
         for record in reader:
           self.assertEqual(record["value"],true_counts[record["key"]])
     finally:
-      # close the process
-      if proc is not None and proc.returncode is None:
-        proc.kill()
       if os.path.exists(base_dir):
         shutil.rmtree(base_dir)
       if exfile is not None and os.path.exists(exfile):