• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 35561
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/gha-deps-c0d9bc5ff9
DEFAULT BRANCH: main
Ran 23 Sep 2020 05:38PM UTC
Jobs 1
Files 437
Run time 42s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
35561

push

travis-ci-com

web-flow
Better Ctrl-C handling in the `test --debug` case (#10835)

### Problem
 
Currently when a user hits Ctrl-C while running the `test` goal with the `--debug` flag (which runs test runner process(es) such as `pytest` foregrounded in the terminal using the `InteractiveProcess` mechanism), pants ends up not cleanly exiting the current test runner process, which continues to run in the background. This is due to two slightly-different problems, depending on whether or not pantsd is running. 

If pantsd is not running, then pants successfully ignores the SIGINT signal sent by a terminal Ctrl-C, and forwards that signal to the test process. This is fine if there is exactly one test process being run by the `test` goal; the test runner process will receive the SIGINT, respond to it (in the case of pytest and probably any other reasonable test runner, by exiting), and that is that. However, if there is more than one test source file associated with a test target, or if more than one test target is specified, another test runner subprocess will be started. It is therefore necessary to keep hitting Ctrl-C until all the test runner subprocesses have been manually killed.

If pantsd is running, then pants fails to ignore the SIGINT signal, captures it, and exits, without doing anything to the test runner process, which `InteractiveProcess` has spawned as a separate child process. So, the test runner process continues to run and print data to the terminal until it is finished.

### Solution

In order to fix the no-pantsd case, we add a new flag `forward_signals_to_process` to the `InteractiveProcess` dataclass to make it possible for clients of `InteractiveProcess` to toggle the signal-capturing behavior. We set this flag to False when running debug-mode tests, and leave it as True for other uses of `InteractiveProcess` such as `run` and `repl`, where we do want the subprocess pants is running to handle SIGINT.

In order to fix the pantsd case, we also ... (continued)

0 of 29455 relevant lines covered (0.0%)

0.0 hits per line

Jobs
ID Job ID Ran Files Coverage
5 35561.5 (PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml" PANTS_DYNAMIC_UI=false LC_ALL="en_US.UTF-8" AWS_BUCKET=ci-public.pantsbuild.org BOOTSTRAPPED_PEX_KEY_PREFIX=daily/${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex NATIVE_ENGINE_SO_KEY_PREFIX=monthly/native_engine_so PYENV_PY27_VERSION=2.7.18 PYENV_PY36_VERSION=3.6.10 PYENV_PY37_VERSION=3.7.7 PYENV_PY38_VERSION=3.8.3 PYENV_ROOT_OSX=${HOME}/.pants_pyenv PYENV_ROOT="${PYENV_ROOT:-${PYENV_ROOT_OSX}}" PATH="${PYENV_ROOT}/shims:${PATH}" AWS_CLI_ROOT="${HOME}/.aws_cli" AWS_ACCESS_KEY_ID__TO_BE_REEXPORTED_ON_DEPLOYS=AKIAV6A6G7RQ2HFZ5KP7 AWS_SECRET_ACCESS_KEY=[secure] RUST_BACKTRACE="all" BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.linux PANTS_REMOTE_CA_CERTS_PATH=/usr/lib/google-cloud-sdk/lib/third_party/grpc/_cython/_credentials/roots.pem CACHE_NAME=python_tests.py36) 23 Sep 2020 05:38PM UTC 0
0.0
Travis Job 35561.5
Source Files on build 35561
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #35561
  • 17b70571 on github
  • Prev Build on master (#35559)
  • Next Build on master (#35563)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc