From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 61DB61F4F8 for ; Tue, 11 Oct 2016 23:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbcJKXc4 (ORCPT ); Tue, 11 Oct 2016 19:32:56 -0400 Received: from tc.outersquare.org ([75.144.255.93]:41243 "EHLO cid.outersquare.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbcJKXcz (ORCPT ); Tue, 11 Oct 2016 19:32:55 -0400 Received: from localhost (localhost [127.0.0.1]) by cid.outersquare.org (Postfix) with ESMTP id EA9AA67C0EF4; Tue, 11 Oct 2016 16:32:53 -0700 (PDT) X-Virus-Scanned: amavisd-new at mydomain = outersquare.org Received: from cid.outersquare.org ([127.0.0.1]) by localhost (cid.outersquare.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Py0zdmFzKDyr; Tue, 11 Oct 2016 16:32:52 -0700 (PDT) Received: from [17.212.151.100] (unknown [17.212.151.100]) by cid.outersquare.org (Postfix) with ESMTPSA id EBA1167C0EDB; Tue, 11 Oct 2016 16:32:51 -0700 (PDT) From: Jeremy Huddleston Sequoia Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_3B41A410-82B6-4D5B-99B1-B414317AC753"; protocol="application/pkcs7-signature"; micalg=sha1 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3249\)) Subject: Re: git 2.10.1 test regression in t3700-add.sh Date: Tue, 11 Oct 2016 16:32:51 -0700 In-Reply-To: Cc: t.gummerer@gmail.com, git@vger.kernel.org To: Junio C Hamano References: <98EB348E-221D-488C-A466-1FACB1C768FF@freedesktop.org> <6CA5F44F-38C1-4C15-9B85-FE84FB93E616@freedesktop.org> <49BF26B2-8E6D-40B1-87A2-1FDDF9A76B8E@freedesktop.org> X-Mailer: Apple Mail (2.3249) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org --Apple-Mail=_3B41A410-82B6-4D5B-99B1-B414317AC753 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 10, 2016, at 10:41, Junio C Hamano wrote: >=20 > Jeremy Huddleston Sequoia writes: >=20 >> Actually, looks like that as just a rabbit hole. The real issue >> looks to be because an earlier test drops down xfoo3 as a symlink, >> which causes this test to fail due to the collision. I'll get out >> a patch in a bit. >=20 > [administrivia: please don't top-post, it is extremely hard to > follow what is going on] >=20 > There indeed is a test that creates xfoo3 as a symbolic link and > leaves it in the filesystem pointing at xfoo2 much earlier in the > sequence. It seems that later one of the "add ignore-errors" tests > (there are two back-to-back) runs "git reset --hard" to make it (and > other symbolic links that are similarly named) go away, namely this > part of the code: >=20 > test_expect_success POSIXPERM,SANITY 'git add --ignore-errors' ' > git reset --hard && > date >foo1 && > date >foo2 && > chmod 0 foo2 && > test_must_fail git add --verbose --ignore-errors . && > git ls-files foo1 | grep foo1 > ' >=20 > rm -f foo2 >=20 > test_expect_success POSIXPERM,SANITY 'git add (add.ignore-errors)' = ' > git config add.ignore-errors 1 && > git reset --hard && > date >foo1 && > date >foo2 && > chmod 0 foo2 && > test_must_fail git add --verbose . && > git ls-files foo1 | grep foo1 > ' > rm -f foo2 >=20 > "git reset --hard" in the first one, because these symbolic links > are not in the index at that point in the sequence, would leave them > untracked and in the working tree. Then "add" is told to be > non-atomic with "--ignore-errors", adding them to the index while > reporting a failure. When the test after that runs "git reset --hard" > again, because these symlinks are in the index (and not in HEAD), > they are removed from the working tree. >=20 > And that is why normal people won't see xfoo3 in later tests, like > the one you had trouble with. >=20 > Are you running without SANITY by any chance (I am not saying that > you are doing a wrong thing--just trying to make sure I am guessing > along the correct route)? Ah, yep. That's the ticket: ok 23 # skip git add should fail atomically upon an unreadable file = (missing SANITY of POSIXPERM,SANITY) ok 24 # skip git add --ignore-errors (missing SANITY of = POSIXPERM,SANITY) ok 25 # skip git add (add.ignore-errors) (missing SANITY of = POSIXPERM,SANITY) ok 26 # skip git add (add.ignore-errors =3D false) (missing SANITY of = POSIXPERM,SANITY) ok 27 # skip --no-ignore-errors overrides config (missing SANITY of = POSIXPERM,SANITY) I dug into it a bit, and since I'm running the tests during a staging = phase which runs as root, !SANITY gets set. Should be solvable by = essentially breaking test out into post-build instead of pre-install. = Thanks for the pointer there. > If that is the issue, then I think the right correction would be to > make sure that the files that an individual test expects to be > missing from the file system is indeed missing by explicitly > removing it, perhaps like this. >=20 > I also notice that the problematic test uses "chmod 755"; don't we > need POSIXPERM prerequisite on this test, too, I wonder? >=20 > Thanks. >=20 > -- >8 -- > t3700: fix broken test under !SANITY >=20 > An "add --chmod=3D+x" test recently added by 610d55af0f ("add: modify > already added files when --chmod is given", 2016-09-14) used "xfoo3" > as a test file. The paths xfoo[1-3] were used by earlier tests for > symbolic links but they were expected to have been removed by the > test script reached this new test. >=20 > The removal with "git reset --hard" however happened in tests that > are protected by POSIXPERM,SANITY prerequisites. Platforms and test > environments that lacked these would have seen xfoo3 as a leftover > symbolic link, pointing somewhere else, and chmod test would have > given a wrong result. >=20 >=20 >=20 > t/t3700-add.sh | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/t/t3700-add.sh b/t/t3700-add.sh > index 924a266126..53c0cb6dea 100755 > --- a/t/t3700-add.sh > +++ b/t/t3700-add.sh > @@ -350,6 +350,7 @@ test_expect_success POSIXPERM,SYMLINKS 'git add = --chmod=3D+x with symlinks' ' > ' >=20 > test_expect_success 'git add --chmod=3D[+-]x changes index with = already added file' ' > + rm -f foo3 xfoo3 && > echo foo >foo3 && > git add foo3 && > git add --chmod=3D+x foo3 && I actually tried that, but the problem is that xfoo3 was previously = added as a symlink, so test_mode_in_index still reports it as a symlink. It's fundamentally a question of who is responsible for cleanup. Is the = individual test responsible for cleaning up after itself (such that = later tests can rely on a clean state), or should individual tests = assume that the initial state might be undefined and try to cleanup = after earlier tests? I'm in favor of either doing the former or = ensuring that tests don't step on each-others toes. --Jeremy --Apple-Mail=_3B41A410-82B6-4D5B-99B1-B414317AC753 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIM5TCCBeIw ggPKoAMCAQICEFy2SG5HDJjGf/aA22RK4o0wDQYJKoZIhvcNAQELBQAwfTELMAkGA1UEBhMCSUwx FjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmlj YXRlIFNpZ25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X DTE1MTIxNjAxMDAwNVoXDTMwMTIxNjAxMDAwNVowdTELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0 YXJ0Q29tIEx0ZC4xKTAnBgNVBAsTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSMw IQYDVQQDExpTdGFydENvbSBDbGFzcyAyIENsaWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBAO4PUIyVCSOErPVQao/WN6JOIf0yCWVHPq84+tUb94TQf8nhBAtX894vxFPjFzjh sTOygm7QiHCcRyFv5PET+rDzzDuHE4O7Dc3wVrGLHprWOnzf5Fa9kdl/vz477cZgGl6Rl9M570D8 WhNdtyDBl8tMxCh2f5yQ2dffUz/UzZ/b/tUDtAGW+KGie3IdA6U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