-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Update googletest to 1.15.2 #36699
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
Update googletest to 1.15.2 #36699
Conversation
Signed-off-by: Alejandro R. Sedeño <[email protected]>
google/googletest@25dcdc7 """ The most notable difference is that unrecognized flags result in a flag parsing error, and are not returned to the user though a modified argc/argv, unless they appear after the positional argument delimiter ("--"). For example, to pass a non-Abseil flag, you would have to do ./mytest --gtest_color=false -- --myflag=myvalue """ Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Per googletest documentation[^1], it is strongly recommended that death tests have names ending in `DeathTest` rather than simply `Test`. This makes those changes. Some death tests behave better when run in a threadsafe manner[^2]. This is a trade-off that costs speed. The flag has been set in tests where it made a difference. [^1]: https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-naming [^2]: https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-styles Signed-off-by: Alejandro R. Sedeño <[email protected]>
When building with bazel and abseil, googletest uses re2[^1]. The switch to re2 means that `.` does not match newline by default. This prefixes regex that need it with `(?s)` to change that behavior[^2]. [^1]: https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-styles [^2]: https://github.com/google/re2/wiki/syntax#flags Signed-off-by: Alejandro R. Sedeño <[email protected]>
googletest has switched from custom-rolled heterogeneous comparator functors to C++ standard ones (e.g., `std::equal_to<>`). The version of clang we're currently using in docker finds two equally good `operator==` overloads here, in which a cast for one operand or the other is necessary, and having not found one unambiguously better operator, fails to build. This has been resolved in newer versions of clang. Since the relevant `operator==` already does its own dynamic casting, drop the `WhenDynamicCastTo<>` from this one `EXPECT_CALL` so it'll build again. Signed-off-by: Alejandro R. Sedeño <[email protected]>
This moves setting `--gmock_default_mock_behavior=2` to the head of `args`, which makes sense in light of the googletest/absel flag changes. This ensures that this googletest flag appears before any `--` separating googletest flags from envoy/test flags. Signed-off-by: Alejandro R. Sedeño <[email protected]>
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to |
cc: @phlax @adisuissa @yanavlasov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pursuing this!
I cannot recall which CI test was problematic, but I hope we can get this solved in this PR.
@@ -4769,7 +4769,8 @@ class AllowForceFail : public Api::OsSysCallsImpl { | |||
bool fail_ = false; | |||
}; | |||
|
|||
TEST_P(ProtocolIntegrationTest, HandleUpstreamSocketCreationFail) { | |||
TEST_P(ProtocolIntegrationDeathTest, HandleUpstreamSocketCreationFail) { | |||
GTEST_FLAG_SET(death_test_style, "threadsafe"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed here (and in some of the other tests)? I thought it is set once in the test_runner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not go digging into why. All I can tell you is that anywhere I set it explicitly, the tests failed without it.
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
0ced0af
to
9c6c7b0
Compare
…ntiation into #ifdef Signed-off-by: Alejandro R. Sedeño <[email protected]>
pulling in the fake @fuchsia_sdk from googletest left it not marked for test only, which made the envoy CI deps check fail. Stripping it out is a very small and simple patch, so let's do that instead. Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
e30755f
to
452d443
Compare
Fun. Coverage tests are failing because the disk is full. From
|
Signed-off-by: Alejandro R. Sedeño <[email protected]>
clang and gcc are being killed building some targets. We can iterate and keep bumping up the rbe_pools for targets one by one, but I don't like it. |
hmm - i added the diskspace-hack (ie delete some of the default installed cruft before running) so i would have hoped this didnt happen - lmc again ...
i have some tooling to identify which jobs need more mem by profiling a complete run with everything running on max mem workers, but tbh, with most of the problematic tasks already identified, doing what you are doing is probably more reliable and less time consuming |
so diskspace hack is running and frees up a fair amount of space but evidently not enough Disk space before cruft removal
Filesystem Size Used Avail Use% Mounted on
/dev/root 73G 58G 16G 80% /
tmpfs 7.9G 172K 7.9G 1% /dev/shm
tmpfs 3.2G 1.1M 3.2G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda15 105M 6.1M 99M 6% /boot/efi
/dev/sdb1 74G 4.1G 66G 6% /mnt
tmpfs 1.6G 12K 1.6G 1% /run/user/1001
Removing: /opt/hostedtoolcache ...
Removing: /usr/local/lib/android ...
Removing: /usr/local/.ghcup ...
Disk after cruft removal
Filesystem Size Used Avail Use% Mounted on
/dev/root 73G 36G 37G 50% /
tmpfs 7.9G 172K 7.9G 1% /dev/shm
tmpfs 3.2G 1.1M 3.2G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda15 105M 6.1M 99M 6% /boot/efi
/dev/sdb1 74G 4.1G 66G 6% /mnt
tmpfs 1.6G 12K 1.6G 1% /run/user/1001 i guess we just need to |
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
In the last Mobile/ASAN run, |
mobile/test/common/BUILD
Outdated
@@ -18,6 +18,7 @@ envoy_cc_test( | |||
envoy_cc_test( | |||
name = "internal_engine_test", | |||
srcs = ["internal_engine_test.cc"], | |||
rbe_pool = "2core", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mobile CI doesnt use these pools
for ref here are the mobile pools:
https://envoy.cluster.engflow.com/restatus
and the envoy ones:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also mobile is not set up to use rbe_pool
so it will either break stuff or at best be ignored
it is, however, OOMing
ERROR: /source/mobile/test/common/BUILD:18:14: Compiling test/common/internal_engine_test.cc failed: (Killed): clang-14 failed: error executing command (from target //test/common:internal_engine_test)
which means there is a bigger issue in terms of mobile workers and resources - probably you will need to raise this on the related channel
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Still OOMing. Waiting on further resources. |
Signed-off-by: Alejandro R. Sedeño <[email protected]>
@@ -31,6 +31,7 @@ envoy_extension_cc_test( | |||
"platform_bridge_filter_integration_test.cc", | |||
], | |||
extension_names = ["envoy.filters.http.platform_bridge"], | |||
rbe_pool = "6gig", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this wont work out of the box - what it actually needs to be is:
exec_properties = {"Pool": "6gig"}
probably it makes sense to set up a macro - so that you can set it as rbe_pool
- see eg
Lines 117 to 120 in 4c09752
exec_properties = exec_properties | select({ | |
repository + "//bazel:engflow_rbe": {"Pool": rbe_pool} if rbe_pool else {}, | |
"//conditions:default": {}, | |
}) |
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
Signed-off-by: Alejandro R. Sedeño <[email protected]>
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Fix #35540
This picks up nearly four years of changes in googletest.
googletest has updated to abseil flags1.
After this upgrade, to set Envoy's CLI arguments in tests requires passing them after
--
.For example,
Per googletest documentation2, it is strongly recommended that death tests
have names ending in
DeathTest
rather than simplyTest
.Some death tests behave better when run in a threadsafe manner3.
This is a trade-off that costs speed. The flag has been set in tests where it made a difference.
When building with bazel and abseil, googletest uses re24. The switch to re2 means
that
.
does not match newline by default. This prefixes regex that need it with(?s)
to change that behavior5.
Risk Level: low — test only
Testing: Updates
Footnotes
https://github.com/google/googletest/commit/25dcdc7e8bfac8967f20fb2c0a628f5cf442188d ↩
https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-naming ↩
https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-styles ↩
https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-styles ↩
https://github.com/google/re2/wiki/syntax#flags ↩