[Binder Transport] Flush ExecCtx in e2e test (#32971)

WireWriter implementation schedules actions to be run by `ExecCtx`. We
should flush pending actions before destructing
`end2end_testing::g_transaction_processor`, which need to be alive to
handle the scheduled actions. Otherwise,
we get heap-use-after-free error because the testing fixture
(`end2end_testing::g_transaction_processor`) is destructed before all
the scheduled actions are run.

This lowers end2end binder transport test failure rate from 0.23% to
0.15%, according to internal tool that runs the test for 15000 times
under various configuration.
pull/32999/head
Ming-Chuan 2 years ago committed by GitHub
parent e872fb91d9
commit 6c2f4371bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      test/core/transport/binder/end2end/end2end_binder_transport_test.cc

@ -50,6 +50,7 @@ class End2EndBinderTransportTest
~End2EndBinderTransportTest() override {
server_->Shutdown();
service_.reset();
exec_ctx.Flush();
delete end2end_testing::g_transaction_processor;
}

Loading…
Cancel
Save