engine icon indicating copy to clipboard operation
engine copied to clipboard

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

Open gaaclarke opened this issue 1 year ago • 1 comments

fixes https://github.com/flutter/flutter/issues/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

  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
  • [x] I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • [x] I listed at least one issue that this PR fixes in the description above.
  • [x] 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.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] I signed the CLA.
  • [x] All existing and new tests are passing.

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

gaaclarke avatar Mar 12 '24 18:03 gaaclarke

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.

flutter-dashboard[bot] avatar Mar 12 '24 21:03 flutter-dashboard[bot]

LGTM, but agree with expect_death if able.

I'll give that another try today.

gaaclarke avatar Mar 14 '24 15:03 gaaclarke

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 avatar Mar 14 '24 16:03 gaaclarke