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

Actually check TEST_SHARD_STATUS_FILE has been touched #18236

Closed
wants to merge 5 commits into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Apr 27, 2023

Adds the missing check that a test runner running a sharded test actually declares support for sharding by generating the TEST_SHARD_STATUS_FILE. Previously, if it didn't, each shard would silently run all tests. This new behavior is guarded by the new --incompatible_check_sharding_support flag.

tools/test/test-setup.sh Outdated Show resolved Hide resolved
@fmeum fmeum force-pushed the test-shard-status-file branch 3 times, most recently from 1745813 to cee1aa2 Compare April 27, 2023 19:12
Adds the missing check that a test runner running a sharded test
actually supports sharding. Previously, if it didn't, each shard would
silently run all tests.

RELNOTES: If sharding is requested for a test but the test runner does
not advertise support for test sharding by touching the
`TEST_SHARD_STATUS_FILE`, the tests will fail instead of silently
running all tests in each shard.
This reverts commit ef47019.
@fmeum fmeum marked this pull request as ready for review April 27, 2023 20:59
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Apr 27, 2023
@fmeum fmeum requested a review from Wyverald April 27, 2023 21:00
Copy link
Member

@Wyverald Wyverald left a comment

Choose a reason for hiding this comment

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

Great!

site/en/reference/test-encyclopedia.md Outdated Show resolved Hide resolved
@Wyverald Wyverald added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels May 2, 2023
@Wyverald
Copy link
Member

Wyverald commented May 2, 2023

@Pavank1992 please merge after the outstanding comment has been addressed. Thanks!

@meteorcloudy
Copy link
Member

Should we cherry pick this in to 6.2.0 or wait for 6.3.0?

@meteorcloudy
Copy link
Member

meteorcloudy commented May 3, 2023

@fmeum Can you file an incompatible flag issue to track the flip of this flag? Basically, follow https://bazel.build/contribute/breaking-changes

@fmeum
Copy link
Collaborator Author

fmeum commented May 6, 2023

@meteorcloudy Done: #18339

@Pavank1992 This is ready for import.

@copybara-service copybara-service bot closed this in f7d795a May 8, 2023
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label May 8, 2023
@fmeum fmeum deleted the test-shard-status-file branch May 8, 2023 11:17
@fmeum
Copy link
Collaborator Author

fmeum commented May 8, 2023

@meteorcloudy Will the new flag be included in downstream runs automatically or is there something else I would need to do for that?

@meteorcloudy
Copy link
Member

@fmeum I just added the migration-ready label to the issue, https://buildkite.com/bazel/bazelisk-plus-incompatible-flags should pick the flag up on next nightly run.

@fmeum
Copy link
Collaborator Author

fmeum commented May 9, 2023

@bazel-io flag

@meteorcloudy
Copy link
Member

@bazel-io fork 6.3.0

@meteorcloudy
Copy link
Member

https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1514#_ may not give the most accurate result since most tests were cached so the check was not actually triggered.

But cherry picking this flag into 6.3.0 is fine since it's off by default anyway, I'm also fine with flipping it at HEAD, if any project breaks, we'll just file issues for them to fix (should be easy).

fmeum added a commit to fmeum/bazel that referenced this pull request May 16, 2023
Adds the missing check that a test runner running a sharded test actually declares support for sharding by generating the `TEST_SHARD_STATUS_FILE`. Previously, if it didn't, each shard would silently run all tests. This new behavior is guarded by the new `--incompatible_check_sharding_support` flag.

Closes bazelbuild#18236.

PiperOrigin-RevId: 530259354
Change-Id: If3b01b2c796e66ad7a77e542145efe3ab412eae9
fmeum added a commit to fmeum/bazel that referenced this pull request May 16, 2023
Adds the missing check that a test runner running a sharded test actually declares support for sharding by generating the `TEST_SHARD_STATUS_FILE`. Previously, if it didn't, each shard would silently run all tests. This new behavior is guarded by the new `--incompatible_check_sharding_support` flag.

Closes bazelbuild#18236.

PiperOrigin-RevId: 530259354
Change-Id: If3b01b2c796e66ad7a77e542145efe3ab412eae9
fweikert pushed a commit to fweikert/bazel that referenced this pull request May 25, 2023
Adds the missing check that a test runner running a sharded test actually declares support for sharding by generating the `TEST_SHARD_STATUS_FILE`. Previously, if it didn't, each shard would silently run all tests. This new behavior is guarded by the new `--incompatible_check_sharding_support` flag.

Closes bazelbuild#18236.

PiperOrigin-RevId: 530259354
Change-Id: If3b01b2c796e66ad7a77e542145efe3ab412eae9
iancha1992 pushed a commit that referenced this pull request Jun 2, 2023
Adds the missing check that a test runner running a sharded test actually declares support for sharding by generating the `TEST_SHARD_STATUS_FILE`. Previously, if it didn't, each shard would silently run all tests. This new behavior is guarded by the new `--incompatible_check_sharding_support` flag.

Closes #18236.

PiperOrigin-RevId: 530259354
Change-Id: If3b01b2c796e66ad7a77e542145efe3ab412eae9

Co-authored-by: keertk <keerthanakumar@google.com>
Co-authored-by: Yun Peng <pcloudy@google.com>
@fmeum
Copy link
Collaborator Author

fmeum commented Feb 17, 2024

I'm seeing tests that are flaky due to this logic in Bazel's own RBE test run: https://buildkite.com/bazel/bazel-bazel-github-presubmit/builds/20155#018db413-588a-46b0-94c2-7b49eb7a7b8c/49-899

@tjgq Do you see anything problematic about this PR? We did include a test with --remote_download=minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants