Bug 1766646 - Vendor libwebrtc from ea9ae5b8bc

Upstream commit: https://webrtc.googlesource.com/src/+/ea9ae5b8bc6ddcc67a88bd3692436b1ccfeac92a
    Destroy threads and TaskQueue at the end of tests.

    On ASan, SimulatedRealTimeControllerConformanceTest is flaky and
    triggers `stack-use-after-scope` because on some occasions, the delayed
    callback gets invoked when the test is tearing down (the callback
    holds a reference to an object allocated on the test function stack).

    This CL ensures threads and TaskQueues are stopped when the tests
    scope is exited. Some flakiness might remain on realtime tests but
    that can only be addressed by increasing the wait.

    Bug: webrtc:12954
    Change-Id: I4ac1a6682e18bb144a3aeb03921a805e3fb39b2d
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225422
    Reviewed-by: Andrey Logvin <[email protected]>
    Reviewed-by: Danil Chapovalov <[email protected]>
    Commit-Queue: Mirko Bonadei <[email protected]>
    Cr-Commit-Position: refs/heads/master@{#34437}
This commit is contained in:
Michael Froman authored and Connor Sheehan committed 2022-08-30 10:28:37 -04:00
1 parent 5a5ab7db3a
commit 11997980a3
3 files changed
+20

No files matched your search

+3
View File
@@ -6849,3 +6849,6 @@ f715618eee
# MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
8bd26e12ed
# MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
ea9ae5b8bc
+2
View File
@@ -4568,3 +4568,5 @@ libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwe
libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-31T18:12:46.229622.
# python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc
libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-31T18:13:26.827361.
# python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc
libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-31T18:14:07.446363.
@@ -92,6 +92,9 @@ TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostOrderTest) {
thread->PostTask(RTC_FROM_HERE, [&]() { execution_order.Executed(2); });
time_controller->AdvanceTime(TimeDelta::Millis(100));
EXPECT_THAT(execution_order.order(), ElementsAreArray({1, 2}));
// Destroy `thread` before `execution_order` to be sure `execution_order`
// is not accessed on the posted task after it is destroyed.
thread = nullptr;
}
TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostDelayedOrderTest) {
@@ -105,6 +108,9 @@ TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostDelayedOrderTest) {
thread->PostTask(ToQueuedTask([&]() { execution_order.Executed(1); }));
time_controller->AdvanceTime(TimeDelta::Millis(600));
EXPECT_THAT(execution_order.order(), ElementsAreArray({1, 2}));
// Destroy `thread` before `execution_order` to be sure `execution_order`
// is not accessed on the posted task after it is destroyed.
thread = nullptr;
}
TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostInvokeOrderTest) {
@@ -119,6 +125,9 @@ TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostInvokeOrderTest) {
thread->Invoke<void>(RTC_FROM_HERE, [&]() { execution_order.Executed(2); });
time_controller->AdvanceTime(TimeDelta::Millis(100));
EXPECT_THAT(execution_order.order(), ElementsAreArray({1, 2}));
// Destroy `thread` before `execution_order` to be sure `execution_order`
// is not accessed on the posted task after it is destroyed.
thread = nullptr;
}
TEST_P(SimulatedRealTimeControllerConformanceTest,
@@ -136,6 +145,9 @@ TEST_P(SimulatedRealTimeControllerConformanceTest,
});
time_controller->AdvanceTime(TimeDelta::Millis(100));
EXPECT_THAT(execution_order.order(), ElementsAreArray({1, 2}));
// Destroy `thread` before `execution_order` to be sure `execution_order`
// is not accessed on the posted task after it is destroyed.
thread = nullptr;
}
TEST_P(SimulatedRealTimeControllerConformanceTest,
@@ -158,6 +170,9 @@ TEST_P(SimulatedRealTimeControllerConformanceTest,
/*warn_after_ms=*/10'000));
time_controller->AdvanceTime(TimeDelta::Millis(100));
EXPECT_THAT(execution_order.order(), ElementsAreArray({1, 2}));
// Destroy `task_queue` before `execution_order` to be sure `execution_order`
// is not accessed on the posted task after it is destroyed.
task_queue = nullptr;
}
INSTANTIATE_TEST_SUITE_P(ConformanceTest,