Skip to contentSkip to conversation

p5310: Fix broken && chain in performance test

PATCH In review Stefan Beller 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 p5310: Fix broken && chain in performance test

---
 t/perf/p5310-pack-bitmaps.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/perf/p5310-pack-bitmaps.sh +3 -3
index f8ed857..de2a224 100755
@@ -39,14 +39,14 @@ test_expect_success 'create partial bitmap state' '
 
 	# now kill off all of the refs and pretend we had
 	# just the one tip
-	rm -rf .git/logs .git/refs/* .git/packed-refs
-	git update-ref HEAD $cutoff
+	rm -rf .git/logs .git/refs/* .git/packed-refs &&
+	git update-ref HEAD $cutoff &&
 
 	# and then repack, which will leave us with a nice
 	# big bitmap pack of the "old" history, and all of
 	# the new history will be loose, as if it had been pushed
 	# up incrementally and exploded via unpack-objects
-	git repack -Ad
+	git repack -Ad &&
 
 	# and now restore our original tip, as if the pushes
 	# had happened
Signature · 1 line
2.4.1.345.gab207b6.dirty
#1 lore raw
Quoted 1 line · Stefan Beller

Thanks. How did you find this (does the auto &&-chain test apply to t/perf stuff as well)?

Will queue.

Quoted 26 lines
---
 t/perf/p5310-pack-bitmaps.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/perf/p5310-pack-bitmaps.sh +3 -3
index f8ed857..de2a224 100755
@@ -39,14 +39,14 @@ test_expect_success 'create partial bitmap state' '
 
 	# now kill off all of the refs and pretend we had
 	# just the one tip
-	rm -rf .git/logs .git/refs/* .git/packed-refs
-	git update-ref HEAD $cutoff
+	rm -rf .git/logs .git/refs/* .git/packed-refs &&
+	git update-ref HEAD $cutoff &&
 
 	# and then repack, which will leave us with a nice
 	# big bitmap pack of the "old" history, and all of
 	# the new history will be loose, as if it had been pushed
 	# up incrementally and exploded via unpack-objects
-	git repack -Ad
+	git repack -Ad &&
 
 	# and now restore our original tip, as if the pushes
 	# had happened
#2 lore raw
Quoted 6 lines · Junio C Hamano
Quoted 1 line · Stefan Beller

Thanks. How did you find this (does the auto &&-chain test apply to t/perf stuff as well)?

Apparently the &&-chain tests for it as I got a warning for it while benchmarking some changes in ALLOC_GROW. (which originally should have fixed the coverity false positives, but I was side tracked wondering about performance)

Quoted 29 lines

Will queue.

Quoted 26 lines
---
 t/perf/p5310-pack-bitmaps.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/perf/p5310-pack-bitmaps.sh +3 -3
index f8ed857..de2a224 100755
@@ -39,14 +39,14 @@ test_expect_success 'create partial bitmap state' '
 
      # now kill off all of the refs and pretend we had
      # just the one tip
-     rm -rf .git/logs .git/refs/* .git/packed-refs
-     git update-ref HEAD $cutoff
+     rm -rf .git/logs .git/refs/* .git/packed-refs &&
+     git update-ref HEAD $cutoff &&
 
      # and then repack, which will leave us with a nice
      # big bitmap pack of the "old" history, and all of
      # the new history will be loose, as if it had been pushed
      # up incrementally and exploded via unpack-objects
-     git repack -Ad
+     git repack -Ad &&
 
      # and now restore our original tip, as if the pushes
      # had happened
#3 lore raw
Quoted 7 lines · Stefan Beller
Quoted 2 lines

Thanks. How did you find this (does the auto &&-chain test apply to t/perf stuff as well)?

Apparently the &&-chain tests for it as I got a warning for it while benchmarking some changes in ALLOC_GROW. (which originally should have fixed the coverity false positives, but I was side tracked wondering about performance)

That makes sense; we use test_expect_success here, so I think it is good for it to check that we are actually creating a sane exit status.

It looks like we do not extend the same protection to test_perf (it uses test_eval_, bnot test_run_). That is probably OK, as those tests are more about measuring the time than about correctness. OTOH, we do notice when a test_perf reports failure, so perhaps it would make sense to extend &&-chaining checks there.

-Peff