# HG changeset patch # User Saurabh Singh # Date 2017-10-05 20:46:49 # Node ID 30ae924a9e0005b4af48baaf90bfc37a23a14744 # Parent 1d804c22c67128dd1b625dd681925d50f1a6fc09 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 diff --git a/tests/test-push-race.t b/tests/test-push-race.t --- a/tests/test-push-race.t +++ b/tests/test-push-race.t @@ -15,7 +15,6 @@ A set of extension and shell functions e > 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 @@ A set of extension and shell functions e > except OSError as exc: > if exc.errno != errno.ENOENT: > raise - > atexit.register(delete) + > ui.atexit(delete) > return orig(pushop) > > def uisetup(ui):