threads / patch / 44267

patcht3700-add.sh: Avoid filename collission between tests which could lead to test failure

Subject: [PATCH] t3700-add.sh: Avoid filename collission between tests which could lead to test failure

## tl;dr

3 messages between Oct 10, 2016 and Oct 10, 2016. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Jeremy Huddleston Sequoia· Oct 10, 2016, 03:57 UTC · lore
Regressed-in: 610d55af0f082f6b866dc858e144c03d8ed4424c
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
CC: Thomas Gummerer <t.gummerer@gmail.com>
CC: Junio C Hamano <gitster@pobox.com>
---
 t/t3700-add.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Show changes to t/t3700-add.sh +5 −5
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index 924a266..3ccb19b 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -354,11 +354,11 @@ test_expect_success 'git add --chmod=[+-]x changes index with already added file
 	git add foo3 &&
 	git add --chmod=+x foo3 &&
 	test_mode_in_index 100755 foo3 &&
-	echo foo >xfoo3 &&
-	chmod 755 xfoo3 &&
-	git add xfoo3 &&
-	git add --chmod=-x xfoo3 &&
-	test_mode_in_index 100644 xfoo3
+	echo foo >xfoo4 &&
+	chmod 755 xfoo4 &&
+	git add xfoo4 &&
+	git add --chmod=-x xfoo4 &&
+	test_mode_in_index 100644 xfoo4
 '
 
 test_expect_success POSIXPERM 'git add --chmod=[+-]x does not change the working tree' '
-- 
2.10.1
Junio C Hamano· Oct 10, 2016, 16:44 UTC · re: Jeremy Huddleston Sequoia · lore

Re: [PATCH] t3700-add.sh: Avoid filename collission between tests which could lead to test failure

Jeremy Huddleston Sequoia <jeremyhu@apple.com> writes:
> Regressed-in: 610d55af0f082f6b866dc858e144c03d8ed4424c
> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
> CC: Thomas Gummerer <t.gummerer@gmail.com>
> CC: Junio C Hamano <gitster@pobox.com>

This is also under-explained. Was the test broken for everybody and you are the first to report, or was your environment somehow different that the existing problem was revealed there first?

Jeremy Huddleston Sequoia· Oct 10, 2016, 17:09 UTC · re: Junio C Hamano · lore

Re: [PATCH] t3700-add.sh: Avoid filename collission between tests which could lead to test failure

Show 12 quoted lines
> On Oct 10, 2016, at 09:44, Junio C Hamano <gitster@pobox.com> wrote:
> 
> Jeremy Huddleston Sequoia <jeremyhu@apple.com> writes:
> 
>> Regressed-in: 610d55af0f082f6b866dc858e144c03d8ed4424c
>> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
>> CC: Thomas Gummerer <t.gummerer@gmail.com>
>> CC: Junio C Hamano <gitster@pobox.com>
> 
> This is also under-explained.  Was the test broken for everybody and
> you are the first to report, or was your environment somehow different
> that the existing problem was revealed there first?
There is nothing obviously different about my environment.  I'd expect this test to fail for everyone that runs the entire test because xfoo3 is not cleaned up after this earlier test:
test_expect_success \
        'git update-index --add: Test that executable bit is not used...' \
        'git config core.filemode 0 &&
         test_ln_s_add xfoo2 xfoo3 &&   # runs git update-index --add
         test_mode_in_index 120000 xfoo3'
If anyone ran the test by itself or otherwise skipped the 'git update-index --add: Test that executable bit is not used...' test, they would not encounter the issue.  However, the normal case is to run all of the tests, so I would expect everyone to be tripping over this issue.  If they're not, then that itself might be indicative of another bug because clearly that previous test just added xfoo3 as a symlink.
--Jeremy

← back to recent threads