comparison tests/test-flagprocessor.t @ 33615:c6146dd10072 stable

tests: fix test-flagprocessor.t flakiness 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. Differential Revision: https://phab.mercurial-scm.org/D202
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 31 Jul 2017 16:32:01 -0700
parents 41081364addb
children 5ac845ca059a
comparison
equal deleted inserted replaced
33614:41081364addb 33615:c6146dd10072
159 $ cat >> .hg/hgrc << EOF 159 $ cat >> .hg/hgrc << EOF
160 > [extensions] 160 > [extensions]
161 > extension=$TESTDIR/flagprocessorext.py 161 > extension=$TESTDIR/flagprocessorext.py
162 > duplicate=$TESTDIR/flagprocessorext.py 162 > duplicate=$TESTDIR/flagprocessorext.py
163 > EOF 163 > EOF
164 $ echo 'this should fail' > file 164 $ hg debugrebuilddirstate
165 $ hg commit -Aqm 'add file'
166 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'. 165 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
166 $ hg st 2>&1 | egrep 'cannot register multiple processors|flagprocessorext'
167 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
168 File "*/tests/flagprocessorext.py", line *, in b64decode (glob)
167 169
168 $ cd .. 170 $ cd ..
169 171
170 # TEST: bundle repo 172 # TEST: bundle repo
171 $ hg init bundletest 173 $ hg init bundletest