# HG changeset patch # User Anton Shestakov # Date 2024-01-24 16:49:29 # Node ID e7be2ddfb4c2a7ac594614d50bcd6f310f1a962e # Parent fa4c4fa232d6e37cd1ecfd87d4b9c06b0664aeda 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. diff --git a/tests/test-censor.t b/tests/test-censor.t --- a/tests/test-censor.t +++ b/tests/test-censor.t @@ -300,7 +300,7 @@ Can censor enough revision to move back rev-count data-size inl type target 8 ??? no file target (glob) (revlogv2 !) 8 ??? yes file target (glob) (revlogv1 !) - $ cat /dev/rand?m | dd bs=512 count=200 2> /dev/null | f --hexdump > target + $ $TESTDIR/seq.py 4000 | $TESTDIR/sha256line.py > target $ hg ci -m 'add 100k passwords' $ H2=`hg id --debug -i` $ C5=$H2