Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5d3cf44

Browse files
chinmaygardezanderso
authored andcommitted
Remove obsolete tests that were time sensitive. (#46686)
These were always filtered away. On Fuchsia, where the filters were not in place, there was an ifdef guard. Followup to flutter/flutter#80457 (comment) --------- Co-authored-by: Zachary Anderson <[email protected]>
1 parent da77b18 commit 5d3cf44

File tree

5 files changed

+1
-170
lines changed

5 files changed

+1
-170
lines changed

ci/licenses_golden/excluded_files

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
../../../flutter/fml/memory/ref_counted_unittest.cc
9898
../../../flutter/fml/memory/task_runner_checker_unittest.cc
9999
../../../flutter/fml/memory/weak_ptr_unittest.cc
100-
../../../flutter/fml/message_loop_impl_unittests.cc
101100
../../../flutter/fml/message_loop_task_queues_merge_unmerge_unittests.cc
102101
../../../flutter/fml/message_loop_task_queues_unittests.cc
103102
../../../flutter/fml/message_loop_unittests.cc

fml/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ if (enable_unittests) {
337337
"memory/ref_counted_unittest.cc",
338338
"memory/task_runner_checker_unittest.cc",
339339
"memory/weak_ptr_unittest.cc",
340-
"message_loop_impl_unittests.cc",
341340
"message_loop_task_queues_merge_unmerge_unittests.cc",
342341
"message_loop_task_queues_unittests.cc",
343342
"message_loop_unittests.cc",

fml/message_loop_impl_unittests.cc

Lines changed: 0 additions & 43 deletions
This file was deleted.

fml/message_loop_unittests.cc

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "flutter/fml/time/chrono_timestamp_provider.h"
1818
#include "gtest/gtest.h"
1919

20-
#define TIMESENSITIVE(x) TimeSensitiveTest_##x
2120
#if FML_OS_WIN
2221
#define PLATFORM_SPECIFIC_CAPTURE(...) [ __VA_ARGS__, count ]
2322
#else
@@ -155,128 +154,6 @@ TEST(MessageLoop, CheckRunsTaskOnCurrentThread) {
155154
thread.join();
156155
}
157156

158-
TEST(MessageLoop, TIMESENSITIVE(SingleDelayedTaskByDelta)) {
159-
#if defined(OS_FUCHSIA)
160-
GTEST_SKIP()
161-
<< "This test does not work on Fuchsia. https://fxbug.dev/110020 ";
162-
#else
163-
164-
bool checked = false;
165-
std::thread thread([&checked]() {
166-
fml::MessageLoop::EnsureInitializedForCurrentThread();
167-
auto& loop = fml::MessageLoop::GetCurrent();
168-
auto begin = fml::ChronoTicksSinceEpoch();
169-
loop.GetTaskRunner()->PostDelayedTask(
170-
[begin, &checked]() {
171-
auto delta = fml::ChronoTicksSinceEpoch() - begin;
172-
auto ms = delta.ToMillisecondsF();
173-
ASSERT_GE(ms, 3);
174-
ASSERT_LE(ms, 7);
175-
checked = true;
176-
fml::MessageLoop::GetCurrent().Terminate();
177-
},
178-
fml::TimeDelta::FromMilliseconds(5));
179-
loop.Run();
180-
});
181-
thread.join();
182-
ASSERT_TRUE(checked);
183-
#endif // OS_FUCHSIA
184-
}
185-
186-
TEST(MessageLoop, TIMESENSITIVE(SingleDelayedTaskForTime)) {
187-
#if defined(OS_FUCHSIA)
188-
GTEST_SKIP()
189-
<< "This test does not work on Fuchsia. https://fxbug.dev/110020 ";
190-
#else
191-
192-
bool checked = false;
193-
std::thread thread([&checked]() {
194-
fml::MessageLoop::EnsureInitializedForCurrentThread();
195-
auto& loop = fml::MessageLoop::GetCurrent();
196-
auto begin = fml::ChronoTicksSinceEpoch();
197-
loop.GetTaskRunner()->PostTaskForTime(
198-
[begin, &checked]() {
199-
auto delta = fml::ChronoTicksSinceEpoch() - begin;
200-
auto ms = delta.ToMillisecondsF();
201-
ASSERT_GE(ms, 3);
202-
ASSERT_LE(ms, 7);
203-
checked = true;
204-
fml::MessageLoop::GetCurrent().Terminate();
205-
},
206-
fml::ChronoTicksSinceEpoch() + fml::TimeDelta::FromMilliseconds(5));
207-
loop.Run();
208-
});
209-
thread.join();
210-
ASSERT_TRUE(checked);
211-
#endif // OS_FUCHSIA
212-
}
213-
214-
TEST(MessageLoop, TIMESENSITIVE(MultipleDelayedTasksWithIncreasingDeltas)) {
215-
#if defined(OS_FUCHSIA)
216-
GTEST_SKIP()
217-
<< "This test does not work on Fuchsia. https://fxbug.dev/110020 ";
218-
#else
219-
220-
const auto count = 10;
221-
int checked = false;
222-
std::thread thread(PLATFORM_SPECIFIC_CAPTURE(&checked)() {
223-
fml::MessageLoop::EnsureInitializedForCurrentThread();
224-
auto& loop = fml::MessageLoop::GetCurrent();
225-
for (int target_ms = 0 + 2; target_ms < count + 2; target_ms++) {
226-
auto begin = fml::ChronoTicksSinceEpoch();
227-
loop.GetTaskRunner()->PostDelayedTask(
228-
PLATFORM_SPECIFIC_CAPTURE(begin, target_ms, &checked)() {
229-
auto delta = fml::ChronoTicksSinceEpoch() - begin;
230-
auto ms = delta.ToMillisecondsF();
231-
ASSERT_GE(ms, target_ms - 2);
232-
ASSERT_LE(ms, target_ms + 2);
233-
checked++;
234-
if (checked == count) {
235-
fml::MessageLoop::GetCurrent().Terminate();
236-
}
237-
},
238-
fml::TimeDelta::FromMilliseconds(target_ms));
239-
}
240-
loop.Run();
241-
});
242-
thread.join();
243-
ASSERT_EQ(checked, count);
244-
#endif // OS_FUCHSIA
245-
}
246-
247-
TEST(MessageLoop, TIMESENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) {
248-
#if defined(OS_FUCHSIA)
249-
GTEST_SKIP()
250-
<< "This test does not work on Fuchsia. https://fxbug.dev/110020 ";
251-
#else
252-
253-
const auto count = 10;
254-
int checked = false;
255-
std::thread thread(PLATFORM_SPECIFIC_CAPTURE(&checked)() {
256-
fml::MessageLoop::EnsureInitializedForCurrentThread();
257-
auto& loop = fml::MessageLoop::GetCurrent();
258-
for (int target_ms = count + 2; target_ms > 0 + 2; target_ms--) {
259-
auto begin = fml::ChronoTicksSinceEpoch();
260-
loop.GetTaskRunner()->PostDelayedTask(
261-
PLATFORM_SPECIFIC_CAPTURE(begin, target_ms, &checked)() {
262-
auto delta = fml::ChronoTicksSinceEpoch() - begin;
263-
auto ms = delta.ToMillisecondsF();
264-
ASSERT_GE(ms, target_ms - 2);
265-
ASSERT_LE(ms, target_ms + 2);
266-
checked++;
267-
if (checked == count) {
268-
fml::MessageLoop::GetCurrent().Terminate();
269-
}
270-
},
271-
fml::TimeDelta::FromMilliseconds(target_ms));
272-
}
273-
loop.Run();
274-
});
275-
thread.join();
276-
ASSERT_EQ(checked, count);
277-
#endif // OS_FUCHSIA
278-
}
279-
280157
TEST(MessageLoop, TaskObserverFire) {
281158
bool started = false;
282159
bool terminated = false;

testing/run_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
ROBOTO_FONT_PATH = os.path.join(FONTS_DIR, 'Roboto-Regular.ttf')
4242
FONT_SUBSET_DIR = os.path.join(BUILDROOT_DIR, 'flutter', 'tools', 'font-subset')
4343

44-
FML_UNITTESTS_FILTER = '--gtest_filter=-*TimeSensitiveTest*'
4544
ENCODING = 'UTF-8'
4645

4746
logger = logging.getLogger(__name__)
@@ -402,7 +401,7 @@ def make_test(name, flags=None, extra_env=None):
402401
make_test('embedder_a11y_unittests'),
403402
make_test('embedder_proctable_unittests'),
404403
make_test('embedder_unittests'),
405-
make_test('fml_unittests', flags=[FML_UNITTESTS_FILTER] + repeat_flags),
404+
make_test('fml_unittests'),
406405
make_test('no_dart_plugin_registrant_unittests'),
407406
make_test('runtime_unittests'),
408407
make_test('testing_unittests'),

0 commit comments

Comments
 (0)