# HG changeset patch # User Matt Harbison # Date 1728765303 14400 # Node ID 3f70ea5bcaebb6ec3978a88bc0a1d9cc43fd67b4 # Parent 625cf96215516057db773637d4dbc2c346160727 tests: use the cross platform `SIGKILL` function This partially fixes `test-transaction-rollback-on-revlog-split.t` (there are still problems related to waiting on the lock files), and completely fixes `test-fncache.t`. diff -r 625cf9621551 -r 3f70ea5bcaeb tests/test-fncache.t --- a/tests/test-fncache.t Sat Oct 12 16:06:37 2024 -0400 +++ b/tests/test-fncache.t Sat Oct 12 16:35:03 2024 -0400 @@ -304,7 +304,7 @@ $ cat > ../exceptionext.py < import os - > import signal + > from mercurial.testing import ps_util > from mercurial import ( > commands, > error, @@ -316,7 +316,7 @@ > def trwrapper(orig, self, *args, **kwargs): > tr = orig(self, *args, **kwargs) > def fail(tr): - > os.kill(os.getpid(), signal.SIGKILL) + > ps_util.kill(os.getpid()) > # zzz prefix to ensure it sorted after store.write > tr.addfinalize(b'zzz-forcefails', fail) > return tr diff -r 625cf9621551 -r 3f70ea5bcaeb tests/test-transaction-rollback-on-revlog-split.t --- a/tests/test-transaction-rollback-on-revlog-split.t Sat Oct 12 16:06:37 2024 -0400 +++ b/tests/test-transaction-rollback-on-revlog-split.t Sat Oct 12 16:35:03 2024 -0400 @@ -8,29 +8,29 @@ $ cat > $TESTTMP/intercept_before_rename.py << EOF > import os - > import signal > from mercurial import extensions, util + > from mercurial.testing import ps_util > > def extsetup(ui): > def rename(orig, src, dest, *args, **kwargs): > path = util.normpath(dest) > if path.endswith(b'data/file.i'): - > os.kill(os.getpid(), signal.SIGKILL) + > ps_util.kill(os.getpid()) > return orig(src, dest, *args, **kwargs) > extensions.wrapfunction(util, 'rename', rename) > EOF $ cat > $TESTTMP/intercept_after_rename.py << EOF > import os - > import signal > from mercurial import extensions, util + > from mercurial.testing import ps_util > > def extsetup(ui): > def close(orig, *args, **kwargs): > path = util.normpath(args[0]._atomictempfile__name) > r = orig(*args, **kwargs) > if path.endswith(b'/.hg/store/data/file.i'): - > os.kill(os.getpid(), signal.SIGKILL) + > ps_util.kill(os.getpid()) > return r > extensions.wrapfunction(util.atomictempfile, 'close', close) > def extsetup(ui): @@ -38,17 +38,17 @@ > path = util.normpath(dest) > r = orig(src, dest, *args, **kwargs) > if path.endswith(b'data/file.i'): - > os.kill(os.getpid(), signal.SIGKILL) + > ps_util.kill(os.getpid()) > return r > extensions.wrapfunction(util, 'rename', rename) > EOF $ cat > $TESTTMP/killme.py << EOF > import os - > import signal + > from mercurial.testing import ps_util > > def killme(ui, repo, hooktype, **kwargs): - > os.kill(os.getpid(), signal.SIGKILL) + > ps_util.kill(os.getpid()) > EOF $ cat > $TESTTMP/reader_wait_split.py << EOF