From: Johannes Sixt <j6t@kdbg.org>
To: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH v2] t1050-large: generate large files without dd
Date: Wed, 14 Jan 2015 21:28:56 +0100 [thread overview]
Message-ID: <54B6D188.7010500@kdbg.org> (raw)
In-Reply-To: <20150114112659.GA23474@peff.net>
For some unknown reason, the dd on my Windows box segfaults randomly,
but since recently, it does so much more often than it used to, which
makes running the test suite burdensome.
Use printf to write large files instead of dd. To emphasize that three
of the large blobs are exact copies, use cp to allocate them.
The new code makes the files a bit smaller, and they are not sparse
anymore, but the tests do not depend on these properties. We do not want
to use test-genrandom here (which is used to generate large files
elsewhere in t1050), so that the files can be compressed well (which
keeps the run-time short).
The files are now large text files, not binary files. But since they
are larger than core.bigfilethreshold they are diagnosed as binary
by Git. For this reason, the 'git diff' tests that check the output
for "Binary files differ" still pass.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
V2:
- use printf instead of test-genrandom
- use test_cmp, not test_cmp_bin because the files are text now
Am 14.01.2015 um 12:27 schrieb Jeff King:
> On Tue, Jan 13, 2015 at 03:40:10PM -0800, Junio C Hamano wrote:
>> Are we depending on the binary-ness of these test files by the way?
>> The leading NUL \0 looked a bit strange to me.
>
> I don't think so. We do not want to do a text diff, because that would
> overflow our GIT_ALLOC_LIMIT. But the core.bigfilethreshold check is
> what will make them binary, not the actual content. So a gigantic text
> file is arguably a better test of the feature in question.
Agreed. The files are text now.
t/t1050-large.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/t/t1050-large.sh b/t/t1050-large.sh
index f5a9119..f9f3d13 100755
--- a/t/t1050-large.sh
+++ b/t/t1050-large.sh
@@ -9,10 +9,10 @@ test_expect_success setup '
# clone does not allow us to pass core.bigfilethreshold to
# new repos, so set core.bigfilethreshold globally
git config --global core.bigfilethreshold 200k &&
- echo X | dd of=large1 bs=1k seek=2000 &&
- echo X | dd of=large2 bs=1k seek=2000 &&
- echo X | dd of=large3 bs=1k seek=2000 &&
- echo Y | dd of=huge bs=1k seek=2500 &&
+ printf "%2000000s" X >large1 &&
+ cp large1 large2 &&
+ cp large1 large3 &&
+ printf "%2500000s" Y >huge &&
GIT_ALLOC_LIMIT=1500k &&
export GIT_ALLOC_LIMIT
'
@@ -61,7 +61,7 @@ test_expect_success 'checkout a large file' '
large1=$(git rev-parse :large1) &&
git update-index --add --cacheinfo 100644 $large1 another &&
git checkout another &&
- cmp large1 another ;# this must not be test_cmp
+ test_cmp large1 another
'
test_expect_success 'packsize limit' '
@@ -162,7 +162,7 @@ test_expect_success 'pack-objects with large loose
object' '
test_create_repo packed &&
mv pack-* packed/.git/objects/pack &&
GIT_DIR=packed/.git git cat-file blob $SHA1 >actual &&
- cmp huge actual
+ test_cmp huge actual
'
test_expect_success 'tar achiving' '
--
2.0.0.12.gbcf935e
next prev parent reply other threads:[~2015-01-14 20:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 17:36 [PATCH] t1050-large: replace dd by test-genrandom Johannes Sixt
2015-01-13 18:56 ` Junio C Hamano
2015-01-13 19:55 ` Johannes Sixt
2015-01-13 21:47 ` Jeff King
2015-01-13 22:33 ` Johannes Sixt
2015-01-13 22:38 ` Jeff King
2015-01-13 23:40 ` Junio C Hamano
2015-01-14 11:27 ` Jeff King
2015-01-14 17:31 ` Junio C Hamano
2015-01-14 20:28 ` Johannes Sixt [this message]
2015-01-14 21:00 ` [PATCH v2] t1050-large: generate large files without dd Jeff King
2015-01-14 21:17 ` Johannes Sixt
2015-01-14 21:59 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54B6D188.7010500@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).