Patchwork D202: tests: fix test-flagprocessor.t flakiness

login
register
mail settings
Submitter phabricator
Date July 31, 2017, 11:58 p.m.
Message ID <differential-rev-PHID-DREV-6vltcqomblvhvgl6fyfb-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/22595/
State Superseded
Headers show

Comments

phabricator - July 31, 2017, 11:58 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The test for duplicate flag processors depended on the timestamps
  being set in the dirstate to work. If the time between the the
  previous failed commit (which would set the timestamp, due to bug
  
  5645. and the attempted commit with the duplicate flag processors was
  
  small enough, it would fail. The failure was caused by a call to
  commands.status() early in the commit process. If the dirstate did not
  have the timestamp set, it would need to fetch the file content to
  compare with. Since two flag processors had been registered, it would
  attempted to base64 decode the contents twice, which would of course
  fail.
  
  This patch adds a "hg debugrebuilddirstate" to make it deterministic
  and also replaces the test case's "hg commit" by simply "hg status",
  since that will trigger reading of the contents and thereby use of the
  flag processors as noted above.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D202

AFFECTED FILES
  tests/test-flagprocessor.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Aug. 1, 2017, 3:39 p.m.
dsp requested changes to this revision.
dsp added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> test-flagprocessor.t:168
> +  *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
> +    File "/usr/local/google/home/martinvonz/hg/tests/flagprocessorext.py", line 38, in b64decode
>  

I think want to either remove this line or glob it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D202

To: martinvonz, #hg-reviewers, dsp
Cc: dsp, mercurial-devel
phabricator - Aug. 1, 2017, 7:52 p.m.
durin42 accepted this revision.
durin42 added a comment.


  queued 201, 202 for stable

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D202

To: martinvonz, #hg-reviewers, dsp, akushner, durin42
Cc: durin42, dsp, mercurial-devel

Patch

diff --git a/tests/test-flagprocessor.t b/tests/test-flagprocessor.t
--- a/tests/test-flagprocessor.t
+++ b/tests/test-flagprocessor.t
@@ -161,9 +161,11 @@ 
   > extension=$TESTDIR/flagprocessorext.py
   > duplicate=$TESTDIR/flagprocessorext.py
   > EOF
-  $ echo 'this should fail' > file
-  $ hg commit -Aqm 'add file'
+  $ hg debugrebuilddirstate
   *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
+  $ hg st 2>&1 | egrep 'cannot register multiple processors|flagprocessorext'
+  *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
+    File "/usr/local/google/home/martinvonz/hg/tests/flagprocessorext.py", line 38, in b64decode
 
   $ cd ..