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

Re: Git Test Coverage Report (v2.20.0-rc0)

From
Derrick Stolee <stolee@gmail.com>
Date
Nov 19, 2018, 21:06 UTC
Message-ID
<d7cbe4d1-36ee-2a3c-7ca5-d2e59a8a750f@gmail.com>
In-Reply-To
<d39320e2-0614-569b-4e82-7f7541589aea@gmail.com>
On 11/19/2018 2:00 PM, Ben Peart wrote:
Show 33 quoted lines
>
>
> On 11/19/2018 10:40 AM, Derrick Stolee wrote:
>>
>> There are a lot of lines introduced by the IEOT extension in these 
>> commits:
>>
>>  > Ben Peart      3255089ad: ieot: add Index Entry Offset Table 
>> (IEOT) extension
>>  > Ben Peart      3b1d9e045: eoie: add End of Index Entry (EOIE) 
>> extension
>>  > Ben Peart      77ff1127a: read-cache: load cache entries on worker 
>> threads
>>  > Ben Peart      abb4bb838: read-cache: load cache extensions on a 
>> worker thread
>>  > Ben Peart      c780b9cfe: config: add new index.threads config 
>> setting
>>  > Ben Peart      d1664e73a: add: speed up cmd_add() by utilizing 
>> read_cache_preload()
>>  > Ben Peart      fa655d841: checkout: optimize "git checkout -b 
>> <new_branch>"
>>
>
> These should be hit if you run the test suite with 
> GIT_TEST_INDEX_THREADS=2.  Without that, the indexes for the various 
> tests are too small to trigger multi-threaded index reads/writes.
>
> From t/README:
>
> GIT_TEST_INDEX_THREADS=<n> enables exercising the multi-threaded loading
> of the index for the whole test suite by bypassing the default number of
> cache entries and thread minimums. Setting this to 1 will make the
> index loading single threaded.

I updated my build to add GIT_TEST_INDEX_THREADS=2 and I still see lots of uncovered stuff, including that load_cache_entries_threaded() is never run.

I added the following diff to my repo and ran the test suite manually with GIT_TEST_INDEX_THREADS=2 and it didn't fail:

diff --git a/read-cache.c b/read-cache.c
index 4ca81286c0..36502586a2 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2057,6 +2057,9 @@ static unsigned long 
load_cache_entries_threaded(struct index_state *istate, con
         struct load_cache_entries_thread_data *data;
         unsigned long consumed = 0;

+       fprintf(stderr, "load_cache_entries_threaded\n");
+       exit(1);
+
         /* a little sanity checking */
         if (istate->name_hash_initialized)
                 BUG("the name hash isn't thread safe");

Am I missing something? Is there another variable I should add?

When I look for where the GIT_TEST_INDEX_THREADS variable is checked, I 
see that the calls to git_config_get_index_threads() are followed by a 
check for NO_PTHREADS (setting the number of threads to 1 again). Is it 
possible that my compiler environment is not allowing me to even compile 
with threads?

Thanks,
-Stolee
Previous: Ben PeartNext: Jeff King
Message 6 of 18 in “Git Test Coverage Report (v2.20.0-rc0)”
  1. Derrick StoleeNov 19, 2018
  2. Derrick StoleeNov 19, 2018
  3. Jeff KingNov 19, 2018
  4. Jeff KingNov 19, 2018
  5. Ben PeartNov 19, 2018
  6. Derrick StoleeNov 19, 2018
  7. Jeff KingNov 20, 2018
  8. Derrick StoleeNov 20, 2018
  9. Jeff KingNov 20, 2018
  10. Ævar Arnfjörð BjarmasonNov 19, 2018
  11. Jonathan NiederNov 19, 2018
  12. Ævar Arnfjörð BjarmasonNov 19, 2018
  13. Derrick StoleeNov 19, 2018
  14. Ævar Arnfjörð BjarmasonNov 19, 2018
  15. Derrick StoleeNov 19, 2018
  16. Derrick StoleeNov 19, 2018
  17. Ævar Arnfjörð BjarmasonNov 19, 2018
  18. Johannes SchindelinNov 20, 2018

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.