-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] fail CI if validations are enabled but not available. #51378
Conversation
@@ -222,5 +222,16 @@ TEST(ContextVKTest, WarmUpFunctionCreatesRenderPass) { | |||
"vkCreateRenderPass") != functions->end()); | |||
} | |||
|
|||
TEST(ContextVKTest, FatalMissingValidations) { |
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.
Is this compiled into impeller_golden_tests
? We should have one of these for that target too.
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 is just a check that the setting works. I've enabled this setting for playgrounds, so I should be able to confirm that removing any of the VVL config causes failures.
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.
What I meant is that we want to make sure that impeller_golden_tests --gtest_filter=ContextVKTest.FatalMissingValidations
is executed too. I suspect this will execute for impeller_tests
but not impeller_golden_tests
.
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.
That doesn't matter though, that isn't what is running the check.
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.
its just a test that the check works
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.
its just a test that the check works
I know =)
that isn't what is running the check.
I know, I want this test running in both executables. In impeller_unittests
and impeller_golden_tests
we should fail if we don't have vulkan validation.
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 looked into this more. It doesn't seem possible for me to set up a playground where validations are requested but still misisng, without mocking out the loader. Did you have a different idea here?
@@ -88,6 +88,9 @@ PlaygroundImplVK::PlaygroundImplVK(PlaygroundSwitches switches) | |||
context_settings.shader_libraries_data = ShaderLibraryMappingsForPlayground(); | |||
context_settings.cache_directory = fml::paths::GetCachesDirectory(); | |||
context_settings.enable_validation = switches_.enable_vulkan_validation; | |||
context_settings.fatal_missing_validations = |
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.
Where is this getting set to true for 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.
IIRC both goldens and regular playground tests go through this path to create the context.
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'm not sure. I'd set a breakpoint in the impeller_golden_tests here to make sure. We swap out playground tests for golden tests in that target so this might not be getting hit. That's why we should make sure we have the test for that executable too (as mentioned in the other comment).
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.
Both impeller unittests and goldens have failed on the commit where I broke run_tests.py:
https://github.com/flutter/engine/pull/51378/checks?check_run_id=22626102272
I think that means its working.
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.
The golden test runner failed from a flake:
[ FAILED ] FlutterEngineTest.CanOverrideBackgroundColor
1 FAILED TEST
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.
It did hit a flake during one of the reruns though.
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.
That failure is when executing impeller_unittests
. Let's GVC when you have a chance. I think I can clear this up in under 5 minutes over gvc =)
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.
In general the change looks good to me, but defer to Aaron on the comments he's left already.
We had a vulkan mind meld yesterday and we're of one minds here. My suggestion is to get this working for the |
okay ... I can't figure out how to do this in the testbed itself. |
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.
lgtm modulo filing an issue for golden test runner and verifying that we aren't getting undefined behavior in EXPECTED_DEATH.
@@ -222,5 +222,16 @@ TEST(ContextVKTest, WarmUpFunctionCreatesRenderPass) { | |||
"vkCreateRenderPass") != functions->end()); | |||
} | |||
|
|||
TEST(ContextVKTest, FatalMissingValidations) { | |||
EXPECT_DEATH(const std::shared_ptr<ContextVK> context = |
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.
Are you getting a warning about running this in a multithreaded environment? This works by forking and catching signals which won't work reliably on multi threaded processes.
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.
Not running locally
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.
Is there a cmd line flag I can test this locally with?
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.
The tests that you execute before your test are going to matter. If ever there is any test that can spawn a thread and not join it, like creating a thread pool, that run before this test it will be a problem. I'd just try running the test runner with every test enabled. Maybe try enabling the test shuffle a few times and seeing if it prints out the error. I almost guarantee there is at least one test that is leaking threads though. That's what I was seeing with the golden test runner at least.
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.
gtest parallel runs multiple gtest processes, if one or more of those process spawn a subprocess that shouldn't cause any issues. The problems we've had usually stem from reading/writing to the file system.
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.
The problem isn't from running the tests in multiple processes, it comes from the signal
function. Which thread will handle a signal is undefined. That's what's being used to catch the death of the process. I'm pretty sure that's why googletest prints out the warning. If you don't see the warning and want to give it a shot that sounds good to me. We should add a comment to the test in case it ever starts flaking.
I can't tell if we are still making progress on this. |
I am waiting on follow up from review from either @chinmaygarde , @gaaclarke or @matanlurey . I cannot make the requested additional test (i don't know how), so either we can land this with tweaks or I can close the PR. |
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.
So, per my understanding, the ask is to request mocking out the loader to simulate the fault?
I think the patch in this state is an improvement over the current state of things and I'm fine landing this to make forward progress.
Right, I need to mock out the failure and mock out parts of the playground harness. I don't think it would be a great test. |
Apologies for missing this. Wanna sync for a few minutes tomorrow morning? Either I can convince you there is a reasonable way to test this or concede let's land it as-is. |
You're probably right btw, it's more me wanting to understand the playground harness more. |
Was there a sync on this? This feels like a generally valuable thing to have. |
There was not. I maintain that 1) the test I am adding is useful and 2) I do not know how to add the second test that Is being requested. I have no plans to work on this further. |
I think this is useful as-is. Let's land it. |
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 validated that the warning isn't being printed out for the 2 instances it's run here: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8751539136032949377/+/u/test:_Host_Tests_for_host_debug/stdout
I would still prefer a comment in case the sheriff runs into flakes otherwise lgtm.
…146357) flutter/engine@d048b9a...62df3bd 2024-04-05 jonahwilliams@google.com [Impeller] fail CI if validations are enabled but not available. (flutter/engine#51378) 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 matanl@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
…lutter#146357) flutter/engine@d048b9a...62df3bd 2024-04-05 jonahwilliams@google.com [Impeller] fail CI if validations are enabled but not available. (flutter/engine#51378) 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 matanl@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
Fixes flutter/flutter#145041
Will test this by unsetting the VVL configuration