git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 5/6] tests: disable GIT_TEST_SPLIT_INDEX for sparse index tests

From
Derrick Stolee <stolee@gmail.com>
Date
Aug 17, 2021, 18:26 UTC
Message-ID
<6f900a58-19b4-753c-18f5-852eaebc1527@gmail.com>
In-Reply-To
<20210817174938.3009923-6-szeder.dev@gmail.com>
On 8/17/2021 1:49 PM, SZEDER Gábor wrote:
Show 25 quoted lines
> The sparse index and split index features are said to be currently
> incompatible [1], and consequently GIT_TEST_SPLIT_INDEX=1 might
> interfere with the test cases exercising the sparse index feature.
> Therefore GIT_TEST_SPLIT_INDEX is already explicitly disabled for the
> whole of 't1092-sparse-checkout-compatibility.sh'.  There are,
> however, two other test cases exercising sparse index, namely
> 'sparse-index enabled and disabled' in
> 't1091-sparse-checkout-builtin.sh' and 'status succeeds with sparse
> index' in 't7519-status-fsmonitor.sh', and these two could fail with
> GIT_TEST_SPLIT_INDEX=1 as well [2].
> 
> Unset GIT_TEST_SPLIT_INDEX and disable the split index in these two
> test cases to avoid such interference.
> 
> Note that this is the minimal change to merely avoid failures when
> these test cases are run with GIT_TEST_SPLIT_INDEX=1.  Interestingly,
> though, without these changes the 'git sparse-checkout init --cone
> --sparse-index' commands still succeed even with split index, and set
> all the necessary configuration variables and create the initial
> '$GIT_DIR/info/sparse-checkout' file, but the test failures are caused
> by later sanity checks finding that the index is not in fact a sparse
> index.  This indicates that 'git sparse-checkout init --sparse-index'
> lacks some error checking and its tests lack coverage related to split
> index, but fixing those issues (let alone making sparse index
> comparible with split index) is beyond the scope of this patch series.
s/comparible/compatible.

I agree that making these two things compatible is not something to solve today. I'm not sure they should _ever_ be solved because of the complexity involved (what if the base index is not sparse but the tip wants to be, or vice-versa?, or if a directory must be expanded because of a conflict?). They use very different approaches to solve a similar problem: how to deal with large index files.

* The split index reduces index _write_ time by only editing a diff
  of the base index.
* The sparse index reduces index _read and write_ time by writing a
  smaller index, but only if the user is using cone mode sparse-
  checkout.
Show 27 quoted lines
>  test_expect_success 'sparse-index enabled and disabled' '
> -	git -C repo sparse-checkout init --cone --sparse-index &&
> -	test_cmp_config -C repo true index.sparse &&
> -	test-tool -C repo read-cache --table >cache &&
> -	grep " tree " cache &&
> -
> -	git -C repo sparse-checkout disable &&
> -	test-tool -C repo read-cache --table >cache &&
> -	! grep " tree " cache &&
> -	git -C repo config --list >config &&
> -	! grep index.sparse config
> +	(
> +		sane_unset GIT_TEST_SPLIT_INDEX &&
> +		git -C repo update-index --no-split-index &&
> +
> +		git -C repo sparse-checkout init --cone --sparse-index &&
> +		test_cmp_config -C repo true index.sparse &&
> +		test-tool -C repo read-cache --table >cache &&
> +		grep " tree " cache &&
> +
> +		git -C repo sparse-checkout disable &&
> +		test-tool -C repo read-cache --table >cache &&
> +		! grep " tree " cache &&
> +		git -C repo config --list >config &&
> +		! grep index.sparse config
> +	)
>  '
This test is safe for now.
>  test_expect_success 'status succeeds with sparse index' '

This test is being edited in ds/sparse-index-ignored-files. v3 of the relevant patch was just sent today [1].

[1] https://lore.kernel.org/git/e66106f7a99d94145eec983ea5e72b7cf8a8a479.1629206603.git.gitgitgadget@gmail.com/

You might want to rebase on top of that topic. The edits to the test are likely stable now.

Thanks, -Stolee

Previous: SZEDER GáborNext: SZEDER Gábor
Message 10 of 23 in “Fix GIT_TEST_SPLIT_INDEX”
  1. 0/6 Fix GIT_TEST_SPLIT_INDEXSZEDER Gábor, Aug 17, 2021
  2. 1/6 t1600-index: remove unnecessary redirectionSZEDER Gábor, Aug 17, 2021
  3. Derrick StoleeAug 17, 2021
  4. SZEDER GáborAug 17, 2021
  5. Derrick StoleeAug 17, 2021
  6. 2/6 t1600-index: don't run git commands upstream of a pipeSZEDER Gábor, Aug 17, 2021
  7. 3/6 t1600-index: disable GIT_TEST_SPLIT_INDEXSZEDER Gábor, Aug 17, 2021
  8. 4/6 read-cache: look for shared index files next to the index, tooSZEDER Gábor, Aug 17, 2021
  9. 5/6 tests: disable GIT_TEST_SPLIT_INDEX for sparse index testsSZEDER Gábor, Aug 17, 2021
  10. Derrick StoleeAug 17, 2021
  11. SZEDER GáborAug 17, 2021
  12. Derrick StoleeAug 18, 2021
  13. 6/6 read-cache: fix GIT_TEST_SPLIT_INDEXSZEDER Gábor, Aug 17, 2021
  14. Derrick StoleeAug 17, 2021
  15. 0/6 Fix GIT_TEST_SPLIT_INDEXSZEDER Gábor, Aug 26, 2021
  16. 1/6 t1600-index: remove unnecessary redirectionSZEDER Gábor, Aug 26, 2021
  17. 2/6 t1600-index: don't run git commands upstream of a pipeSZEDER Gábor, Aug 26, 2021
  18. 3/6 t1600-index: disable GIT_TEST_SPLIT_INDEXSZEDER Gábor, Aug 26, 2021
  19. 4/6 read-cache: look for shared index files next to the index, tooSZEDER Gábor, Aug 26, 2021
  20. 6/6 read-cache: fix GIT_TEST_SPLIT_INDEXSZEDER Gábor, Aug 26, 2021
  21. 5/6 tests: disable GIT_TEST_SPLIT_INDEX for sparse index testsSZEDER Gábor, Aug 26, 2021
  22. Derrick StoleeAug 31, 2021
  23. Junio C HamanoAug 31, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.