diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index d97eeba15b..d60856a0a9 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -317,6 +317,15 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) { // Stop all client started tasks to prevent their access to any call related // objects after these objects will be destroyed during call tear down. executor_->Stop(); + // There is no guarantee, that last stats collection will happen at the end + // of the call, so we force it after executor, which is among others is doing + // stats collection, was stopped. + task_queue_->SendTask( + [&stats_poller]() { + // Get final end-of-call stats. + stats_poller.PollStatsAndNotifyObservers(); + }, + RTC_FROM_HERE); // We need to detach AEC dumping from peers, because dump uses |task_queue_| // inside. alice_->DetachAecDump();