When a timeout triggers, first do SIGTERM, then wait a bit, and then do SIGKILL

Review Request #3479 - Created Feb. 19, 2016 and submitted

Information
Sameer Brenn
pants
2949
Reviewers
pants-reviews
benjyw, kwlzn, nhoward_tw, stuhood

The current implementation of timeouts sends a SIGKILL to the test, which doesn't let it write out XML files and whatnot. This change sends a SIGTERM, and gives it 10 seconds (by default. configurable with a new option) to die. If it doesn't die within 10 seconds, send a SIGKILL.

% ./build-support/bin/unit-test.sh 
<success>
% ./pants test.pytest --timeout-default=1 testprojects/tests/python/pants/timeout:ignores_terminate
09:27:47 00:01       [run]

09:27:47 00:01         [chroot]============== test session starts ===============
                     platform darwin -- Python 2.7.10 -- py-1.4.31 -- pytest-2.6.4
                     plugins: cov, timeout
                     collected 1 items 

                     testprojects/tests/python/pants/timeout/test_ignores_terminate.py WARN] Timed out test did not terminate gracefully after 10 seconds, killing...

FAILURE: Timeout of 1 seconds reached


09:27:58 00:12   [complete]
               FAILURE
% ./pants test tests/python/pants_test/backend/python/tasks:pytest_run_integration
<success>
% ./pants test tests/python/pants_test/task:testrunner_task_mixin
<success>

Travis: https://travis-ci.org/pantsbuild/pants/builds/110994889

Issues

  • 0
  • 6
  • 0
  • 6
Description From Last Updated
Benjy Weinberger
Sameer Brenn
Sameer Brenn
Benjy Weinberger
Stu Hood
Sameer Brenn
Sameer Brenn
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 9c1d155043210bf058ef7f16170f4094f1bb1e41

Loading...