[go: nahoru, domu]

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

[Impeller] started asserting golden test runner has fatal impeller validations #51357

Merged
merged 7 commits into from
Mar 14, 2024

Conversation

gaaclarke
Copy link
Member
@gaaclarke gaaclarke commented Mar 12, 2024

fixes flutter/flutter#145017

This works by removing the conditional compilation for validation and turning them to be fatal in the test runner's main.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@@ -24,7 +25,14 @@ void print_usage() {
}
} // namespace

namespace impeller {
TEST(ValidationTest, IsFatal) {
EXPECT_TRUE(ImpellerValidationErrorsAreFatal());
Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to use EXPECT_EXIT but I couldn't get it to stop killing the process.

Copy link
Member

Choose a reason for hiding this comment

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

You want to use EXPECT_DEATH?

That seems to work for me

@gaaclarke gaaclarke changed the title [Impeller] started asserting test runners have fatal validations [Impeller] started asserting golden test runner has fatal validations Mar 12, 2024
@gaaclarke gaaclarke marked this pull request as ready for review March 12, 2024 20:58
@gaaclarke gaaclarke changed the title [Impeller] started asserting golden test runner has fatal validations [Impeller] started asserting golden test runner has fatal impeller validations Mar 12, 2024
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Contributor
@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

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

LGTM, but agree with expect_death if able.

@gaaclarke
Copy link
Member Author

LGTM, but agree with expect_death if able.

I'll give that another try today.

@gaaclarke
Copy link
Member Author

Yea looks like EXPECT_DEATH is unreliable in processes with more than one thread:

[ RUN      ] ValidationTest.IsFatal

[WARNING] ../../flutter/third_party/googletest/googletest/src/gtest-death-test.cc:1102:: Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 6 threads. See https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads for more explanation and suggested solutions, especially if this is the last message you see before your test times out.
[FATAL:flutter/impeller/base/validation.cc(57)] Break on 'ImpellerValidationBreak' to inspect point of failure: 
Abort trap: 6

I looked to see if I could make sure the test happens first, presumably before the other threads are spawned, and it doesn't look like there is a way to make that the case reliably with googletest.

@gaaclarke gaaclarke merged commit cc1e7d1 into flutter:main Mar 14, 2024
23 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 14, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 14, 2024
…145164)

flutter/engine@41fce3f...cc1e7d1

2024-03-14 30870216+gaaclarke@users.noreply.github.com [Impeller] started asserting golden test runner has fatal impeller validations (flutter/engine#51357)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants