Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing up python lint issues
  • Loading branch information
pwendell committed Aug 2, 2015
commit 7f1ff75f84011919866041ea71f125af466728d4
27 changes: 16 additions & 11 deletions dev/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,20 +283,25 @@ def get_hadoop_profiles(hadoop_version):
" are", sbt_maven_hadoop_profiles.keys())
sys.exit(int(os.environ.get("CURRENT_BLOCK", 255)))


def get_zinc_port():
"""
Get a randomized port on which to start Zinc
"""
return random.randrange(3030, 4030)
"""
Get a randomized port on which to start Zinc
"""

return random.randrange(3030, 4030)


def kill_zinc_on_port(zinc_port):
"""
Kill the Zinc process running on the given port, if one exists.
"""
cmd = ("/usr/sbin/lsof -P |grep %s | grep LISTEN "
"| awk '{ print $2; }' | xargs kill") % zinc_port
# TODO: Not sure what happens here if no process exists
run_cmd(cmd)
"""
Kill the Zinc process running on the given port, if one exists.
"""

cmd = ("/usr/sbin/lsof -P |grep %s | grep LISTEN "
"| awk '{ print $2; }' | xargs kill") % zinc_port
# TODO: Not sure what happens here if no process exists
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a non-zero exit code, run_cmd will print an error message and will call sys.exit(), so we may want to ensure that this always returns a zero exit code. If this is a concern, you could always just perform the underlying subprocess call yourself.

run_cmd(cmd)


def build_spark_maven(hadoop_version):
# Enable all of the profiles for the build:
Expand Down