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

Re: [PATCH] trace2 tests: guard pthread test with "PTHREAD"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 28, 2022, 17:50 UTC
Message-ID
<221128.86wn7fj72k.gmgdl@evledraar.gmail.com>
In-Reply-To
<6c725ed6-4d74-c260-98fb-dc965b4647ee@jeffhostetler.com>
On Mon, Nov 28 2022, Jeff Hostetler wrote:
Show 14 quoted lines
> On 11/25/22 3:05 AM, Ævar Arnfjörð Bjarmason wrote:
> [...]
>> That was my thought as well, but these tests are specifically testing
>> how it interacts with threading. The counter mechanism works in general
>> without threading.
>> The test descriptions don't help, and should really say that they're
>> to
>> do with threading in particular, but I wanted to keep this as small as
>> possible for rc[12] and the final, so I didn't fix that while-at-it.
>
> There is large comment block above `have_timer_event()` and
> `have_counter_event()` in t0211 that explained the purpose of the
> test1 and test2 tests for each.  Would it help if that text were moved
> down before each of the individual tests rather than where it is now?
You did ask :)

I think that better than a comment is to have the test description itself reflect the nature & purpose of the test.

Now the two are:
	test_expect_success 'global counter test/test1' '
	test_expect_success PTHREAD 'global counter test/test2' '

So at least the PTHREAD shows that it's something to do with threading, but if it fails with that prereq passed you'll need to consult the source to see what "test2" is supposed to do. Better would be to just skip the comment & work "single threaded" and "multi-threaded" etc. into the test name itself.

Ditto symbol names "ut_200counter" and "ut_201counter", again, a comment somewhere in t/helper/test-trace2.c notes that they're single- and multi-threaded, respectively, but why not skip that and make the symbol names self-descriptive?

Previous: Jeff HostetlerNext: Jeff Hostetler
Message 5 of 6 in “trace2 tests: guard pthread test with "PTHREAD"”
  1. trace2 tests: guard pthread test with "PTHREAD"Ævar Arnfjörð Bjarmason, Nov 24, 2022
  2. Junio C HamanoNov 25, 2022
  3. Ævar Arnfjörð BjarmasonNov 25, 2022
  4. Jeff HostetlerNov 28, 2022
  5. Ævar Arnfjörð BjarmasonNov 28, 2022
  6. Jeff HostetlerNov 30, 2022

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.