Add periodic alive message logging to prevent test infra think, that test is dead
Bug: webrtc:10138
Change-Id: Ib39ff6df81776a7784687be2dc16ab81c500cc3e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137428
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28005}
diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc
index ecc909b..5541f13 100644
--- a/test/pc/e2e/peer_connection_quality_test.cc
+++ b/test/pc/e2e/peer_connection_quality_test.cc
@@ -52,6 +52,8 @@
constexpr TimeDelta kStatsUpdateInterval = TimeDelta::Seconds<1>();
constexpr TimeDelta kStatsPollingStopTimeout = TimeDelta::Seconds<1>();
+constexpr TimeDelta kAliveMessageLogInterval = TimeDelta::Seconds<30>();
+
std::string VideoConfigSourcePresenceToString(const VideoConfig& video_config) {
char buf[1024];
rtc::SimpleStringBuilder builder(buf);
@@ -317,6 +319,14 @@
webrtc::RtcEventLog::kImmediateOutput);
}
+ // Setup alive logging. It is done to prevent test infra to think that test is
+ // dead.
+ RepeatingTaskHandle::DelayedStart(task_queue_->Get(),
+ kAliveMessageLogInterval, []() {
+ std::printf("Test is still running...\n");
+ return kAliveMessageLogInterval;
+ });
+
// Setup call.
signaling_thread->Invoke<void>(
RTC_FROM_HERE,
@@ -362,10 +372,15 @@
// inside.
alice_->DetachAecDump();
bob_->DetachAecDump();
- // Destroy |task_queue_|. It is done to stop all running tasks and prevent
- // their access to any call related objects after these objects will be
- // destroyed during call tear down.
- task_queue_.reset();
+ // Stop all client started tasks on task queue to prevent their access to any
+ // call related objects after these objects will be destroyed during call tear
+ // down.
+ task_queue_->SendTask([this]() {
+ rtc::CritScope crit(&lock_);
+ for (auto& handle : repeating_task_handles_) {
+ handle.Stop();
+ }
+ });
// Tear down the call.
signaling_thread->Invoke<void>(
RTC_FROM_HERE,
@@ -383,6 +398,9 @@
reporter->StopAndReportResults();
}
+ // Reset |task_queue_| after test to cleanup.
+ task_queue_.reset();
+
// Ensuring that TestPeers have been destroyed in order to correctly close
// Audio dumps.
RTC_CHECK(!alice_);