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

x/build: improve LUCI builder test sharding strategy for the main Go repository #65814

Open
mknyszek opened this issue Feb 20, 2024 · 0 comments
Labels
Builders x/build issues (builders, bots, dashboards) NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. ToolSpeed
Milestone

Comments

@mknyszek
Copy link
Contributor

mknyszek commented Feb 20, 2024

The current test sharding strategy for the LUCI builders is to generate 4 test shards and distribute the go tool dist test -list tests across them via a hash of their names. This strategy means the test execution order and grouping is deterministic, which is useful for reproducibility, but doesn't take into account how long the tests take to run.

As a result, we've observed differences in test shard run times up to 2x (longest vs. shortest). The worst cases tend to be on builders where certain tests are disproportionately slower, either because of the build mode or the platform. (The race mode builders and Windows builders are hit particularly hard.)

There are a few things we can do to fix this. The easiest one is to just find a hash that distributes the tests more evenly. This seems fragile at first, but the go tool dist test -list names change very infrequently, so this might work well. Another is to weigh the tests according to historical runtimes on a particular builder, and bucket them according to some load balancing scheme. (Probably not on every run; we still value determinism, so the weights will probably be hard-coded and updated only occasionally.)

We can probably get back a few minutes of build latency for presubmit runs this way.

@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Feb 20, 2024
@gopherbot gopherbot added this to the Unreleased milestone Feb 20, 2024
@prattmic prattmic added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. ToolSpeed
Projects
Status: Planned
Development

No branches or pull requests

4 participants