comparison tests/test-censor.t @ 51362:e7be2ddfb4c2 stable

tests: use sha256line.py instead of /dev/random in test-censor.t (issue6858) Sometimes the systems that run our test suite don't have enough entropy and they cannot produce target file of the expected size using /dev/random, which results in test failures. Switching to /dev/urandom would give us way more available data at the cost of it being less "random", but we don't really need to use entropy for this task at all, since we only care if the file size after compression is big enough to not be stored inline in the revlog. So let's use something that we already have used to generate this kind of data in other tests.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 24 Jan 2024 13:49:29 -0300
parents c7edfccfc11f
children 508fd40dc86a
comparison
equal deleted inserted replaced
51361:fa4c4fa232d6 51362:e7be2ddfb4c2
298 298
299 $ hg debugrevlogstats | grep target 299 $ hg debugrevlogstats | grep target
300 rev-count data-size inl type target 300 rev-count data-size inl type target
301 8 ??? no file target (glob) (revlogv2 !) 301 8 ??? no file target (glob) (revlogv2 !)
302 8 ??? yes file target (glob) (revlogv1 !) 302 8 ??? yes file target (glob) (revlogv1 !)
303 $ cat /dev/rand?m | dd bs=512 count=200 2> /dev/null | f --hexdump > target 303 $ $TESTDIR/seq.py 4000 | $TESTDIR/sha256line.py > target
304 $ hg ci -m 'add 100k passwords' 304 $ hg ci -m 'add 100k passwords'
305 $ H2=`hg id --debug -i` 305 $ H2=`hg id --debug -i`
306 $ C5=$H2 306 $ C5=$H2
307 $ hg revert -r "$H2^" target 307 $ hg revert -r "$H2^" target
308 $ hg ci -m 'cleaned 100k passwords' 308 $ hg ci -m 'cleaned 100k passwords'