Patchwork [1,of,2] test: extract develwarn transaction testing in its own command

login
register
mail settings
Submitter Pierre-Yves David
Date May 13, 2016, 3:07 p.m.
Message ID <d0c4dd6d292cc13c1ec2.1463152041@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/15103/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Pierre-Yves David - May 13, 2016, 3:07 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1462457602 -7200
#      Thu May 05 16:13:22 2016 +0200
# Node ID d0c4dd6d292cc13c1ec2046d296380ba37c88033
# Parent  983874e22594cebf97f24f7c4d2d28480a90a54f
# EXP-Topic consistencycleanup
test: extract develwarn transaction testing in its own command

The lack of locking for a transation is about to change from a warning to an
error. We first extract the test decidated to this warning to make the next
changeset clearer.
timeless - May 15, 2016, 3:04 p.m.
> The lack of locking for a transation [sp] is about to change from a
warning to an

I should continue my spelling auditor to catch such things...

Patch

diff -r 983874e22594 -r d0c4dd6d292c tests/test-devel-warnings.t
--- a/tests/test-devel-warnings.t	Fri May 13 03:31:07 2016 +0530
+++ b/tests/test-devel-warnings.t	Thu May 05 16:13:22 2016 +0200
@@ -10,14 +10,17 @@ 
   > 
   > @command('buggylocking', [], '')
   > def buggylocking(ui, repo):
-  >     tr = repo.transaction('buggy')
-  >     # make sure we rollback the transaction as we don't want to rely on the__del__
-  >     tr.release()
   >     lo = repo.lock()
   >     wl = repo.wlock()
   >     wl.release()
   >     lo.release()
   > 
+  > @command('buggytransaction', [], '')
+  > def buggylocking(ui, repo):
+  >     tr = repo.transaction('buggy')
+  >     # make sure we rollback the transaction as we don't want to rely on the__del__
+  >     tr.release()
+  > 
   > @command('properlocking', [], '')
   > def properlocking(ui, repo):
   >     """check that reentrance is fine"""
@@ -74,7 +77,6 @@ 
   $ hg init lock-checker
   $ cd lock-checker
   $ hg buggylocking
-  devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
   devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
   $ cat << EOF >> $HGRCPATH
   > [devel]
@@ -82,21 +84,8 @@ 
   > check-locks=1
   > EOF
   $ hg buggylocking
-  devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
   devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
   $ hg buggylocking --traceback
-  devel-warn: transaction with no lock at:
-   */hg:* in * (glob)
-   */mercurial/dispatch.py:* in run (glob)
-   */mercurial/dispatch.py:* in dispatch (glob)
-   */mercurial/dispatch.py:* in _runcatch (glob)
-   */mercurial/dispatch.py:* in _dispatch (glob)
-   */mercurial/dispatch.py:* in runcommand (glob)
-   */mercurial/dispatch.py:* in _runcommand (glob)
-   */mercurial/dispatch.py:* in checkargs (glob)
-   */mercurial/dispatch.py:* in <lambda> (glob)
-   */mercurial/util.py:* in check (glob)
-   $TESTTMP/buggylocking.py:* in buggylocking (glob)
   devel-warn: "wlock" acquired after "lock" at:
    */hg:* in * (glob)
    */mercurial/dispatch.py:* in run (glob)
@@ -167,4 +156,10 @@ 
    $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
   1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
   1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 9
+
+Test programming error failure:
+
+  $ hg buggytransaction
+  devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
+
   $ cd ..