Mercurial > hg-stable
changeset 34507:30ae924a9e00
test-push-race: use 'ui.atexit' instead of python's 'atexit'
Callbacks registered with 'atexit' are sometimes not called (like when a
process is killed by the SIGTERM signal). Therefore, this commit replaces it
with 'ui.atexit' which ensures that the callbacks are always called. This also
makes the test compatible with chg.
Test Plan:
Ran the test 'test-push-race.t' with and without the '--chg' option.
Differential Revision: https://phab.mercurial-scm.org/D957
author | Saurabh Singh <singhsrb@fb.com> |
---|---|
date | Thu, 05 Oct 2017 20:46:49 +0000 |
parents | 1d804c22c671 |
children | b521b3a79afd |
files | tests/test-push-race.t |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-push-race.t Mon Oct 02 04:48:06 2017 +0530 +++ b/tests/test-push-race.t Thu Oct 05 20:46:49 2017 +0000 @@ -15,7 +15,6 @@ > Client with the extensions will create a file when ready and get stuck until > a file is created.""" > - > import atexit > import errno > import os > import time @@ -51,7 +50,7 @@ > except OSError as exc: > if exc.errno != errno.ENOENT: > raise - > atexit.register(delete) + > ui.atexit(delete) > return orig(pushop) > > def uisetup(ui):