Use threadsafe death testing for dispatcher tests
Prior to this CL, the dispatcher death tests used to run in the "fast"
style. That made their execution faster, but also resulted in occasional
hangups of the testing method.
The test would fail because it would get stuck forever.
The failure was reproducible every ~100 runs on device. Failure could
not be reproduced on host, though.
In this CL, we switch to the "threadsafe" approach for running this
test. It makes the test slower, but in practice it's still fast enough,
taking less than 100ms per execution.
At the same time, I could not reproduce a failure in a similar death
test, the UntrustedSpy_AbortsDispatcher one. That test ran successfully
10000 times on the device, with about 15 ms per execution.
So we are only adding this parameter to the untrusted overlay one for
now.
Bug: 282837934
Test: m inputflinger_tests && adb sync data && adb shell -t data/nativetest64/inputflinger_tests/inputflinger_tests --gtest_filter="*UntrustedOverlay_AbortsDispatcher*" --gtest_repeat=1000
Change-Id: I747e17a3e191d910c02ad71241d3fad9a9599158
diff --git a/services/inputflinger/tests/InputDispatcher_test.cpp b/services/inputflinger/tests/InputDispatcher_test.cpp
index 3aec02c..5af9999 100644
--- a/services/inputflinger/tests/InputDispatcher_test.cpp
+++ b/services/inputflinger/tests/InputDispatcher_test.cpp
@@ -9584,6 +9584,7 @@
using InputDispatcherStylusInterceptorDeathTest = InputDispatcherStylusInterceptorTest;
TEST_F(InputDispatcherStylusInterceptorDeathTest, UntrustedOverlay_AbortsDispatcher) {
+ testing::GTEST_FLAG(death_test_style) = "threadsafe";
ScopedSilentDeath _silentDeath;
auto [overlay, window] = setupStylusOverlayScenario();