Skip to content

Commit e2b0574

Browse files
derrickstoleegitster
authored andcommitted
t1092: use GIT_PROGRESS_DELAY for consistent results
The t1092-sparse-checkout-compatibility.sh tests compare the stdout and stderr for several Git commands across both full checkouts, sparse checkouts with a full index, and sparse checkouts with a sparse index. Since these are direct comparisons, sometimes a progress indicator can flush at unpredictable points, especially on slower machines. This causes the tests to be flaky. One standard way to avoid this is to add GIT_PROGRESS_DELAY=0 to the Git commands that are run, as this will force every progress indicator created with start_progress_delay() to be created immediately. However, there are some progress indicators that are created in the case of a full index that are not created with a sparse index. Moreover, their values may be different as those indexes have a different number of entries. Instead, use GIT_PROGRESS_DELAY=-1 (which will turn into UINT_MAX) to ensure that any reasonable machine running these tests would never display delayed progress indicators. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent de88ac7 commit e2b0574

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,18 @@ init_repos () {
106106
run_on_sparse () {
107107
(
108108
cd sparse-checkout &&
109-
"$@" >../sparse-checkout-out 2>../sparse-checkout-err
109+
GIT_PROGRESS_DELAY=-1 "$@" >../sparse-checkout-out 2>../sparse-checkout-err
110110
) &&
111111
(
112112
cd sparse-index &&
113-
"$@" >../sparse-index-out 2>../sparse-index-err
113+
GIT_PROGRESS_DELAY=-1 "$@" >../sparse-index-out 2>../sparse-index-err
114114
)
115115
}
116116

117117
run_on_all () {
118118
(
119119
cd full-checkout &&
120-
"$@" >../full-checkout-out 2>../full-checkout-err
120+
GIT_PROGRESS_DELAY=-1 "$@" >../full-checkout-out 2>../full-checkout-err
121121
) &&
122122
run_on_sparse "$@"
123123
}

0 commit comments

Comments
 (0)