Skip to content

Conversation

jhump
Copy link
Member

@jhump jhump commented Nov 30, 2023

This introduces two new flags to the connectconformance runner:

  1. max-servers: the number of concurrent server processes to start. Test cases for all of them will be written to the client's stdin in parallel (thread-safe, but interleaving test cases for various servers). Defaults to 4.
  2. parallel: the number of RPCs to issue in parallel when --mode is server (so this only controls the reference client). In --mode of client, it's up to the client-under-test to implement parallelism. Defaults to 4 * GOMAXPROC (and GOMAXPROC defaults to the number of CPU cores detected).

This speeds up conformance runs on my MBP from about 3 minutes down to less than 15 seconds,.

@jhump jhump requested a review from smaye81 November 30, 2023 22:08
@jhump
Copy link
Member Author

jhump commented Dec 5, 2023

@smaye81, ping

@smaye81
Copy link
Member

smaye81 commented Dec 5, 2023

Nice! Tested this on my machine too and it was much faster.

@jhump jhump merged commit 17ef1dc into main Dec 6, 2023
@jhump jhump deleted the jh/parallel branch December 6, 2023 01:30
jhump added a commit that referenced this pull request Dec 6, 2023
This is a follow-up to #720.

Since that PR is merged, accessing the `outWriter` and `errWriter` from
multiple goroutines is racy. Even if the underlying writer were
thread-safe, this means that writing a message or line could end up
being "interrupted" by a concurrent write, interleaving lines and
leaving the output unreadable. This commit fixes that by
introducing a `Printer` interface with a thread-safe implementation
to do logging.

To make sure there aren't any actual data races in this code, this also
adds a new test that exercises a more significant portion of the
conformance test runner, including the concurrent aspects of the
runner. So running `go test -race` can now verify that these aspects
are race-free.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants