Commit e5fd51b0 authored by Kevin Marshall's avatar Kevin Marshall Committed by Commit Bot

Raise time limits for AudioSyncReader::Read() for test on Fuchsia.

Fuchsia, running on the test bots, was sometimes taking too long to
return data to AudioSyncReader (observed 21ms, max 20ms), which
lead to test flakes.


Bug: 838367
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: If2e25357acd70eaa28c6e618e696cc39ea9ba372
Reviewed-on: https://chromium-review.googlesource.com/1036196
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarMax Morin <maxmorin@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555128}
parent ceab9594
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "base/task_runner.h" #include "base/task_runner.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "media/audio/audio_sync_reader.h" #include "media/audio/audio_sync_reader.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -342,6 +343,15 @@ struct TestEnvironment { ...@@ -342,6 +343,15 @@ struct TestEnvironment {
/*log callback*/ base::DoNothing(), params, std::move(shared_memory), /*log callback*/ base::DoNothing(), params, std::move(shared_memory),
std::move(browser_socket)); std::move(browser_socket));
time_stamp = base::TimeTicks::Now(); time_stamp = base::TimeTicks::Now();
#if defined(OS_FUCHSIA)
// Raise the timeout limits to reduce bot flakiness.
// Fuchsia's task scheduler suffers from bad jitter on systems running many
// tests simultaneously on nested virtualized deployments (e.g. test bots),
// leading some read operations to randomly timeout.
reader->set_max_wait_timeout_for_test(
base::TimeDelta::FromMilliseconds(50));
#endif
} }
base::CancelableSyncSocket renderer_socket; base::CancelableSyncSocket renderer_socket;
......
...@@ -57,6 +57,10 @@ class MEDIA_EXPORT AudioSyncReader : public AudioOutputController::SyncReader { ...@@ -57,6 +57,10 @@ class MEDIA_EXPORT AudioSyncReader : public AudioOutputController::SyncReader {
return shared_memory_.get(); return shared_memory_.get();
} }
void set_max_wait_timeout_for_test(base::TimeDelta time) {
maximum_wait_time_ = time;
}
// AudioOutputController::SyncReader implementations. // AudioOutputController::SyncReader implementations.
void RequestMoreData(base::TimeDelta delay, void RequestMoreData(base::TimeDelta delay,
base::TimeTicks delay_timestamp, base::TimeTicks delay_timestamp,
...@@ -97,7 +101,7 @@ class MEDIA_EXPORT AudioSyncReader : public AudioOutputController::SyncReader { ...@@ -97,7 +101,7 @@ class MEDIA_EXPORT AudioSyncReader : public AudioOutputController::SyncReader {
// The maximum amount of time to wait for data from the renderer. Calculated // The maximum amount of time to wait for data from the renderer. Calculated
// from the parameters given at construction. // from the parameters given at construction.
const base::TimeDelta maximum_wait_time_; base::TimeDelta maximum_wait_time_;
// The index of the audio buffer we're expecting to be sent from the renderer; // The index of the audio buffer we're expecting to be sent from the renderer;
// used to block with timeout for audio data. // used to block with timeout for audio data.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment