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

Flip --incompatible_check_sharding_support #18354

Closed
wants to merge 1 commit into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented May 9, 2023

RELNOTES[INC]: --incompatible_check_sharding_support is enabled by default. Sharded tests with test runners that do not properly advertise support for test sharding will fail. Refer to #18339 for migration advice.

@fmeum fmeum requested a review from a team as a code owner May 9, 2023 12:47
@fmeum fmeum requested review from gregestren, meteorcloudy, a team and aranguyen and removed request for a team, gregestren and aranguyen May 9, 2023 12:47
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions labels May 9, 2023
@meteorcloudy
Copy link
Member

The current downstream pipeline is not in a great state, I'll approve this as soon as I think it's ready.

@fmeum fmeum force-pushed the patch-1 branch 4 times, most recently from 72691ad to d3fcfb4 Compare May 9, 2023 15:21
@gregestren gregestren added team-Local-Exec Issues and PRs for the Execution (Local) team and removed team-Configurability platforms, toolchains, cquery, select(), config transitions labels May 10, 2023
@meteorcloudy
Copy link
Member

meteorcloudy commented May 16, 2023

@fmeum Can you rebase this PR to Bazel HEAD and I'll start a downstream testing for this change?

@fmeum
Copy link
Collaborator Author

fmeum commented May 16, 2023

@meteorcloudy Updated

@meteorcloudy
Copy link
Member

Thanks, here we go: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3028

@meteorcloudy
Copy link
Member

@meteorcloudy
Copy link
Member

But the strings_test, sharding did work:

pcloudy@pcloudy-macbookpro3:~/workspace/my_tests/bazel (master)
$ cat bazel-testlogs/src/test/cpp/util/strings_test/shard_1_of_2/test.log
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //src/test/cpp/util:strings_test
-----------------------------------------------------------------------------
Running main() from gmock_main.cc
Note: This is test shard 1 of 2.
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from BlazeUtil
[ RUN      ] BlazeUtil.JoinStrings
[       OK ] BlazeUtil.JoinStrings (0 ms)
[ RUN      ] BlazeUtil.Replace
[       OK ] BlazeUtil.Replace (0 ms)
[ RUN      ] BlazeUtil.Tokenize
[       OK ] BlazeUtil.Tokenize (0 ms)
[ RUN      ] BlazeUtil.StringPrintf
[       OK ] BlazeUtil.StringPrintf (0 ms)
[----------] 4 tests from BlazeUtil (0 ms total)

[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 4 tests.
pcloudy@pcloudy-macbookpro3:~/workspace/my_tests/bazel (master)
$ cat bazel-testlogs/src/test/cpp/util/strings_test/shard_2_of_2/test.log
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //src/test/cpp/util:strings_test
-----------------------------------------------------------------------------
Running main() from gmock_main.cc
Note: This is test shard 2 of 2.
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from BlazeUtil
[ RUN      ] BlazeUtil.Split
[       OK ] BlazeUtil.Split (0 ms)
[ RUN      ] BlazeUtil.StripWhitespace
[       OK ] BlazeUtil.StripWhitespace (0 ms)
[ RUN      ] BlazeUtil.SplitQuoted
[       OK ] BlazeUtil.SplitQuoted (0 ms)
[ RUN      ] BlazeUtil.EndsWithTest
[       OK ] BlazeUtil.EndsWithTest (0 ms)
[----------] 4 tests from BlazeUtil (0 ms total)

[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 4 tests.

Not sure why the check failed.

@meteorcloudy
Copy link
Member

https://github.com/search?q=repo%3Agoogle%2Fgoogletest%20TEST_SHARD_STATUS_FILE&type=code, is it because it's called GTEST_SHARD_STATUS_FILE?

@meteorcloudy
Copy link
Member

Oh no, I found the following copybara transformation for googletests:

        "TEST_SHARD_INDEX": "GTEST_SHARD_INDEX",
        "TEST_SHARD_STATUS_FILE": "GTEST_SHARD_STATUS_FILE",
        "TEST_TOTAL_SHARDS": "GTEST_TOTAL_SHARDS",

@fmeum
Copy link
Collaborator Author

fmeum commented May 16, 2023

I saw that variant while working on this PR and already wondered how it could work - turns out it doesn't?

@meteorcloudy
Copy link
Member

turns out it doesn't?

I think so, unless we also pass and check those env vars?

@fmeum
Copy link
Collaborator Author

fmeum commented May 17, 2023

@meteorcloudy I pushed two commits that should fix this, could you run the downstream test again?

@meteorcloudy
Copy link
Member

Here you go: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3035

But I guess it's better to submit the fixes in a different PR so that we can also cherry pick them for 6.3.0.

@fmeum
Copy link
Collaborator Author

fmeum commented May 19, 2023

But I guess it's better to submit the fixes in a different PR so that we can also cherry pick them for 6.3.0.

Will do, but the flip PR is really the only way for me to test whether they are indeed effective.

@meteorcloudy
Copy link
Member

Thanks! We can always stack the flag flip on top of the fix to test, just like this one ;)

@meteorcloudy
Copy link
Member

Looks like only Kythe was broken due to the flag flip: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3035#0188343c-bd18-4174-a702-55c777bce2e3

@fmeum
Copy link
Collaborator Author

fmeum commented May 22, 2023

rules_go didn't declare support correctly and while the issue is fixed at HEAD, we still need to have a release.

@meteorcloudy
Copy link
Member

@fmeum Can you submit the fixes as a separate PR, then we can merge and cherry pick that one, then flip the flag at HEAD.

@fmeum
Copy link
Collaborator Author

fmeum commented May 22, 2023

@meteorcloudy Submitted #18469

@meteorcloudy
Copy link
Member

@fmeum Thanks, #18469 is merged, please rebase and we can also merge this one ;)

@fmeum
Copy link
Collaborator Author

fmeum commented May 24, 2023

@meteorcloudy Done

RELNOTES[INC]: `--incompatible_check_sharding_support` is enabled by default. Sharded tests with test runners that do not properly advertise support for test sharding will fail. Refer to bazelbuild#18339 for migration advice.
@meteorcloudy meteorcloudy 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 24, 2023
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label May 25, 2023
fweikert pushed a commit to fweikert/bazel that referenced this pull request May 25, 2023
RELNOTES[INC]: `--incompatible_check_sharding_support` is enabled by default. Sharded tests with test runners that do not properly advertise support for test sharding will fail. Refer to bazelbuild#18339 for migration advice.

Closes bazelbuild#18354.

PiperOrigin-RevId: 535154319
Change-Id: I0f7ccd404ed59c2f9542ddbc1cb0c803dbb442c9
@fmeum fmeum deleted the patch-1 branch May 27, 2023 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Local-Exec Issues and PRs for the Execution (Local) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants