From 5aa05b8ef496e9601e74ba3a43240ae9bb3d14aa Mon Sep 17 00:00:00 2001
From: Todd Gamblin <tgamblin@llnl.gov>
Date: Mon, 24 Sep 2018 14:55:36 -0700
Subject: [PATCH] travis: require sudo in an attempt to avoid build timeouts
 (#9327)

- Many container builds are timing out frequently during Spack tests in
  Travis CI.

- Travis recommends to try `sudo: required` to see whether this is an
  infrastructure issue or something else.

- added `sudo: required` to all Linux builds.

- added --verbose to `spack test` invocation so that we can see more
  easily what tests it's timing out on.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
---
 .travis.yml                   | 9 ++++++++-
 share/spack/qa/run-unit-tests | 6 +++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index bfce03216b..34d8e5c3d3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,37 +23,44 @@ jobs:
   include:
     - stage: 'style checks'
       python: '2.7'
+      sudo: required
       os: linux
       language: python
       env: TEST_SUITE=flake8
     - stage: 'unit tests + documentation'
       python: '2.6'
+      sudo: required
       os: linux
       language: python
       env: TEST_SUITE=unit
     - python: '2.7'
+      sudo: required
       os: linux
       language: python
       env: TEST_SUITE=unit
     - python: '3.4'
+      sudo: required
       os: linux
       language: python
       env: TEST_SUITE=unit
     - python: '3.5'
+      sudo: required
       os: linux
       language: python
       env: TEST_SUITE=unit
     - python: '3.6'
+      sudo: required
       os: linux
       language: python
       env: TEST_SUITE=unit
     - python: '3.7'
+      sudo: required
       os: linux
       dist: xenial
-      sudo: true
       language: python
       env: TEST_SUITE=unit
     - python: '3.6'
+      sudo: required
       os: linux
       language: python
       env: TEST_SUITE=doc
diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests
index 68c214ef95..d96144f28a 100755
--- a/share/spack/qa/run-unit-tests
+++ b/share/spack/qa/run-unit-tests
@@ -28,4 +28,8 @@ ${coverage_run} bin/spack help -a
 ${coverage_run} bin/spack -p --lines 20 spec mpileaks%gcc ^elfutils@0.170
 
 # Run unit tests with code coverage
-${coverage_run} bin/spack test "$@"
+extra_args=""
+if [[ -n "$@" ]]; then
+    extra_args="-k $@"
+fi
+${coverage_run} bin/spack test --verbose "$extra_args"
-- 
GitLab