Subject: Re: [PATCH v15 6/6] unpack-objects: use stream_loose_object() to unpack large objects

From: Junio C Hamano <[email-masked]>
Date: Thu, 30 Jun 2022 19:01:03 -0700

Han Xin <[email-masked]> writes:

> +BATCH_CONFIGURATION='-c core.fsync=loose-object -c core.fsyncmethod=batch'
> +
> +test_expect_success 'unpack big object in stream (core.fsyncmethod=batch)' '
> +	prepare_dest 1m &&
> +	GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
> +		git -C dest.git $BATCH_CONFIGURATION unpack-objects <pack-$PACK.pack &&
> +	grep fsync/hardware-flush trace2.txt &&
> +	test_dir_is_empty dest.git/objects/pack &&
> +	git -C dest.git cat-file --batch-check="%(objectname)" <obj-list >current &&
> +	cmp obj-list current
> +'

This test without any prerequisite expects that "hardware-flush"
will always appear in the trace, but is that reasonable?  Don't
we need either 

 (1) some sort of prerequisite to make sure this test piece runs
     only on platforms that will use hardware-flush, or

 (2) loosen grep pattern to look for just "fsync/", or

 (3) something else?

It will become even worse when we queue Ævar's "trace2 squelch"
patch on top, as we will stop emitting trace entries for that did
not trigger.