Skip to content

Commit 62329d3

Browse files
committed
Merge branch 'ds/trace2-regions-in-tests'
The default setting for trace2 event nesting was too low to cause test failures, which is worked around by bumping it up in the test framework. * ds/trace2-regions-in-tests: t/t*: remove custom GIT_TRACE2_EVENT_NESTING test-lib.sh: set GIT_TRACE2_EVENT_NESTING
2 parents 2859079 + 8c4cbad commit 62329d3

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ test_expect_success 'submodule handling' '
784784
test_expect_success 'sparse-index is expanded and converted back' '
785785
init_repos &&
786786
787-
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \
787+
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
788788
git -C sparse-index reset -- folder1/a &&
789789
test_region index convert_to_sparse trace2.txt &&
790790
test_region index ensure_full_index trace2.txt
@@ -829,10 +829,10 @@ ensure_not_expanded () {
829829
then
830830
shift &&
831831
test_must_fail env \
832-
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \
832+
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
833833
git -C sparse-index "$@" || return 1
834834
else
835-
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \
835+
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
836836
git -C sparse-index "$@" || return 1
837837
fi &&
838838
test_region ! index ensure_full_index trace2.txt

t/t4216-log-bloom.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,11 @@ test_expect_success 'persist filter settings' '
175175
test_when_finished rm -rf .git/objects/info/commit-graph* &&
176176
rm -rf .git/objects/info/commit-graph* &&
177177
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
178-
GIT_TRACE2_EVENT_NESTING=5 \
179178
GIT_TEST_BLOOM_SETTINGS_NUM_HASHES=9 \
180179
GIT_TEST_BLOOM_SETTINGS_BITS_PER_ENTRY=15 \
181180
git commit-graph write --reachable --changed-paths &&
182181
grep "{\"hash_version\":1,\"num_hashes\":9,\"bits_per_entry\":15,\"max_changed_paths\":512" trace2.txt &&
183182
GIT_TRACE2_EVENT="$(pwd)/trace2-auto.txt" \
184-
GIT_TRACE2_EVENT_NESTING=5 \
185183
git commit-graph write --reachable --changed-paths &&
186184
grep "{\"hash_version\":1,\"num_hashes\":9,\"bits_per_entry\":15,\"max_changed_paths\":512" trace2-auto.txt
187185
'

t/t5310-pack-bitmaps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test_expect_success 'setup writing bitmaps during repack' '
3535
'
3636

3737
test_expect_success 'full repack creates bitmaps' '
38-
GIT_TRACE2_EVENT_NESTING=4 GIT_TRACE2_EVENT="$(pwd)/trace" \
38+
GIT_TRACE2_EVENT="$(pwd)/trace" \
3939
git repack -ad &&
4040
ls .git/objects/pack/ | grep bitmap >output &&
4141
test_line_count = 1 output &&

t/t5705-session-id-in-capabilities.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ do
3232
test_when_finished "git -C local push --delete origin new-branch" &&
3333
cp -r "$LOCAL_PRISTINE" local &&
3434
git -C local pull --no-rebase origin &&
35-
GIT_TRACE2_EVENT_NESTING=5 \
3635
GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
3736
git -c protocol.version=$PROTO -C local push \
3837
--receive-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-receive-pack" \
@@ -65,7 +64,6 @@ do
6564
test_when_finished "git -C local push --delete origin new-branch" &&
6665
cp -r "$LOCAL_PRISTINE" local &&
6766
git -C local pull --no-rebase origin &&
68-
GIT_TRACE2_EVENT_NESTING=5 \
6967
GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
7068
git -c protocol.version=$PROTO -C local push \
7169
--receive-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-receive-pack" \

t/t7519-status-fsmonitor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ test_expect_success 'status succeeds after staging/unstaging' '
390390
# during a call to 'git status'. Otherwise, we verify that we _do_ call it.
391391
check_sparse_index_behavior () {
392392
git -C full status --porcelain=v2 >expect &&
393-
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \
393+
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" \
394394
git -C sparse status --porcelain=v2 >actual &&
395395
test_region $1 index ensure_full_index trace2.txt &&
396396
test_region fsm_hook query trace2.txt &&

t/test-lib.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,13 @@ export GIT_TEST_MERGE_ALGORITHM
476476
GIT_TRACE_BARE=1
477477
export GIT_TRACE_BARE
478478

479+
# Some tests scan the GIT_TRACE2_EVENT feed for events, but the
480+
# default depth is 2, which frequently causes issues when the
481+
# events are wrapped in new regions. Set it to a sufficiently
482+
# large depth to avoid custom changes in the test suite.
483+
GIT_TRACE2_EVENT_NESTING=100
484+
export GIT_TRACE2_EVENT_NESTING
485+
479486
# Use specific version of the index file format
480487
if test -n "${GIT_TEST_INDEX_VERSION:+isset}"
481488
then

0 commit comments

Comments
 (0)