-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] for testing : Fix 4Gb limit for large files on Git for Windows #2179
base: main
Are you sure you want to change the base?
Changes from 1 commit
5b60f72
9c2f8de
5554ca1
f05d8a6
fc00458
a4b2bb5
fb1a906
2ea5193
4bf4bda
21d51c0
8891566
eeb79ff
a8e0ee7
a85708c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
test_description='test large file handling on windows' | ||
. ./test-lib.sh | ||
|
||
test_expect_success SIZE_T_IS_64BIT 'require 64bit size_t' ' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The commit message claims that this is for Windows, but the prereq does not actually test that. You will want to use the prereq Besides, I think that To that end, I would like to imitate the way we test for And when we do that, we do not even need the Finally, I think it would make sense to fold the commit that introduces the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the initial test was incomplete, and just sufficient to ensure I could see all the steps that include a long conversion. When I looked at the use of zlib there were 28 places! so a lot of different parts of the test could be impacted, hence checks everywhere. I also wanted to explicitly test that the zlib compile flags were the problematic ones. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's indeed what you should do while developing the test case. Once your done, it needs to be polished to serve the particular use case to allow easy debugging of future regressions. And that is where I think that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The compile flags should be part of the pre-requisite to detect that Size_t is 64 bit but zlib is only 32bit.. which is currently part of the >4Gb failing case. Your right it's not in there yet but should be (not sure how to do it yet though). |
||
|
||
dd if=/dev/zero of=file bs=1M count=4100 && | ||
git config core.compression 0 && | ||
git config core.looseCompression 0 && | ||
git add file && | ||
git verify-pack -s .git/objects/pack/*.pack && | ||
git fsck --verbose --strict --full && | ||
git commit -m msg file && | ||
git log --stat && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather leave this out. It might have made sense for debugging when this patch was developed, but the test case should be optimized for catching, diagnosing and debugging future regressions, nothing more, nothing less. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. depends on the testing criteria. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I regularly investigate test failures in Git's test suite, as I am one of the very few who even looks at our CI builds. You should try it, too. It's very educative. I can tell you precisely how I feel about test cases like this one, but you would have to hide younger children first. In short: no, let's not do this. Let's not make life hard on the developers who will inevitably have to investigate regressions. Let's make it easy instead. The shorter, conciser, and more meaningful we can make the test case, the better. Remember: regression tests are not so much about finding regressions, as they are about helping regressions to be fixed. That is the criteria you should aim to optimize for. Always. |
||
git gc && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really want to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Almost very step is error prone and some do not repeat outside of the test environment (differing big file threshold effects I think) i.e. pack vs loose object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then we really need a more robust test. Otherwise a developer might be tempted to think that they fixed a flawed regression test, all the while a real regression crept in. So please indulge me: what exactly is this regression test case supposed to test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an expansion of the 'does it perform correctly' test that Thomas B initially developed. Each of the fsck, verify-pack, log and gc commands can barf. Plus if run manually it actually does a slightly different test (add to loose vs pack), which I didn't get to the bottom of! In this case he had deliberately set the compression to zero so that the compressed file would exceed the limit, we also 'need' (if we are to be complete) to check for packed and loose encoding, etc etc (including breakages at various process stages, add vs commit, I'd agree that the testing still has a long way to go to get a smooth set of tests that satisfy all. It's all low level code issues that can pop up in many places. It may be that we have a two phase plan. First make the code patches visible (if the code isn't working...), then make the testing acceptable (to as yet unknown/discussed/decided standards). |
||
git fsck --verbose --strict --full && | ||
git index-pack -v -o test.idx .git/objects/pack/*.pack && | ||
git gc && | ||
git fsck | ||
' | ||
|
||
test_done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After I read this commit message, I wonder how we can munge it to look more like the other commit messages in Git. I.e. if you compare the commit message e.g. of 581d2fd to this:
then it is hard not to spot a stark difference. Maybe we could write something like this instead:
Thoughts?
BTW I have no idea what you mean by this:
I do not see this at all in this here patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sha1 check was one of the reported values in the test but I only manually checked it against what I'd seen via WSL.
the test (and hence message) should also cover the zlib compile flags (not sure if we can determine the crc32 compile flags)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a change of those flags constitute a regression? If not (which I think is the case), then it should not be tested.
Ah, okay. I am not sure that is strictly an interesting information for the commit message, but more for the cover letter.