Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize conformance test runs in CI #1110

Merged
merged 16 commits into from
Jun 19, 2024
Merged

Conversation

smaye81
Copy link
Member

@smaye81 smaye81 commented Jun 17, 2024

This parallelizes the various test runs for conformance in CI to minimize the duration of the entire process.

Previously, the repo was basically only running the web and conformance tests in parallel. However, each of these have various runs which were running serially. Now, each conformance suite run is split into its own Github workflow. In addition, Node version matrices were added to the Node-related conformance runs to add further coverage without affecting overall time. This results in the following all running concurrently:

Node tests:

  • connect-express conformance (Node versions 18, 20, 21)
  • connect-fastify conformance (Node versions 18, 20, 21)
  • connect-node conformance (Node versions 18, 20, 21)

Web tests:

  • connect-web conformance (Chrome)
  • connect-web conformance (Firefox)
  • connect-web conformance (Safari)

Note that conformance tests are still run as part of the all default goal, so local runs of just make are unaffected. However, the conformance tests are no longer a pre-req of the test target, so simply running test will not run the conformance tests. To do so, run make testconformance.

The above enhancements result in an improvement of approximately 8 minutes on CI runs. The overall run duration is tied to the longest individual workflow, which happens to be connect-web conformance in Chrome at 5 minutes. Therefore, the overall run is around 5 minutes, where previously it was 13 minutes or more.

@smaye81 smaye81 force-pushed the sayers/conformance_workflows branch from 780326a to 9755053 Compare June 17, 2024 18:01
@smaye81 smaye81 changed the title Testing GH actions Parallelize conformance test runs in CI Jun 17, 2024
@smaye81 smaye81 marked this pull request as ready for review June 17, 2024 18:43
Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement!

There are still two cases of sequential runs:

  • node runs server and client tests in sequence.
  • web runs promise client and callback client in sequence.

Parallelizing both can potentially bring overall runtime below 3min. Considering that we want to move to turborepo, it may not be worth it to further split up the jobs.

But I do wonder why chrome tests takes significantly longer than the two other browsers. Looking at these two runs, chrome takes as long as safari and firefox combined: A, B. Is there something wrong with our setup?

@smaye81
Copy link
Member Author

smaye81 commented Jun 18, 2024

Our setup should be OK. I checked it against webdriver's docs and it looks fine to me. It's a bit variable too. In this run, the safari tests seem to have taken a bit longer and chrome's tests were around 3m. So, this may be a function of how long it takes the chrome driver to start? Not entirely sure.

Also updated to further parallelize so now we're around 4 minutes or so. I don't love that proliferation of checks now and how the Makefile has kind of blown up, so if you know of a better way around this, lmk. Just feels kind of unwieldy and hard to maintain as-is.

smaye81 and others added 13 commits June 18, 2024 13:22
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
chore: fix some comments

Signed-off-by: sjtucoder <sjtucoder@icloud.com>
Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
@smaye81 smaye81 force-pushed the sayers/conformance_workflows branch from e5ac897 to a278f48 Compare June 18, 2024 17:22
@timostamm
Copy link
Member

timostamm commented Jun 19, 2024

Thanks for looking into chrome.

Also updated to further parallelize so now we're around 4 minutes or so. I don't love that proliferation of checks now and how the Makefile has kind of blown up, so if you know of a better way around this, lmk. Just feels kind of unwieldy and hard to maintain as-is.

I agree. It's a lot of boilerplate to save 1 minute.

IMO we should punt on it, and parallelize further with #798.

Signed-off-by: Steve Ayers <sayers@buf.build>
Signed-off-by: Steve Ayers <sayers@buf.build>
@smaye81
Copy link
Member Author

smaye81 commented Jun 19, 2024

@timostamm sounds good. I merged in your changes from #1111 and reverted the commits that further parallelized callback vs. promise client and Node clients and servers.

Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@smaye81 smaye81 merged commit 4464e71 into main Jun 19, 2024
17 checks passed
@smaye81 smaye81 deleted the sayers/conformance_workflows branch June 19, 2024 16:40
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.

3 participants