Skip to content

Commit

Permalink
Filter out all remaining base tests on Fuchsia.
Browse files Browse the repository at this point in the history
This removes all the remaining disabled tests in the filter file for
base tests on Fuchsia and instead filters each of them individually.

Bug: 738275, 752368, 753490, 810077, 811881, 851734, 851747, 851759, 851760
Change-Id: I375954138d09ebacc05b2ad37afe1e09901e52e2
Reviewed-on: https://chromium-review.googlesource.com/1096483
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568112}
  • Loading branch information
Steelskin authored and Commit Bot committed Jun 18, 2018
1 parent 19da8cb commit 62c7155
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ void RandomBitCorrelation(int random_bit) {
}
}

// TODO(crbug.com/811881): These are flaky on Fuchsia
#if !defined(OS_FUCHSIA)

// Tests are fairly slow, so give each random bit its own test.
#define TEST_RANDOM_BIT(BIT) \
TEST(AddressSpaceRandomizationTest, RandomBitCorrelations##BIT) { \
Expand Down Expand Up @@ -239,6 +242,8 @@ TEST_RANDOM_BIT(48)
// No platforms have more than 48 address bits.
#endif // defined(ARCH_CPU_64_BITS)

#endif // defined(OS_FUCHSIA)

#undef TEST_RANDOM_BIT

} // namespace base
4 changes: 3 additions & 1 deletion base/files/file_proxy_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ TEST_F(FileProxyTest, WriteAndFlush) {
}
}

#if defined(OS_ANDROID)
#if defined(OS_ANDROID) || defined(OS_FUCHSIA)
// Flaky on Android, see http://crbug.com/489602
// TODO(crbug.com/851734): Implementation depends on stat, which is not
// implemented on Fuchsia
#define MAYBE_SetTimes DISABLED_SetTimes
#else
#define MAYBE_SetTimes SetTimes
Expand Down
17 changes: 15 additions & 2 deletions base/files/file_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2422,7 +2422,14 @@ TEST_F(FileUtilTest, CreateAndOpenTemporaryFileTest) {
}
}

TEST_F(FileUtilTest, FileToFILE) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/851747): Re-enable when the Fuchsia-side fix for fdopen has
// been rolled into Chromium.
#define MAYBE_FileToFILE DISABLED_FileToFILE
#else
#define MAYBE_FileToFILE FileToFILE
#endif
TEST_F(FileUtilTest, MAYBE_FileToFILE) {
File file;
FILE* stream = FileToFILE(std::move(file), "w");
EXPECT_FALSE(stream);
Expand Down Expand Up @@ -3643,7 +3650,13 @@ TEST_F(FileUtilTest, NonExistentContentUriTest) {
// Test that temp files obtained racily are all unique (no interference between
// threads). Mimics file operations in DoLaunchChildTestProcess() to rule out
// thread-safety issues @ https://crbug.com/826408#c17.
TEST(FileUtilMultiThreadedTest, MultiThreadedTempFiles) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/844416): Too slow to run on infra due to QEMU overloads.
#define MAYBE_MultiThreadedTempFiles DISABLED_MultiThreadedTempFiles
#else
#define MAYBE_MultiThreadedTempFiles MultiThreadedTempFiles
#endif
TEST(FileUtilMultiThreadedTest, MAYBE_MultiThreadedTempFiles) {
constexpr int kNumThreads = 64;
constexpr int kNumWritesPerThread = 32;

Expand Down
8 changes: 7 additions & 1 deletion base/message_loop/message_loop_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,13 @@ TEST_P(MessageLoopTypedTest, RunLoopQuitOrderAfter) {
// On Linux, the pipe buffer size is 64KiB by default. The bug caused one
// byte accumulated in the pipe per two posts, so we should repeat 128K
// times to reproduce the bug.
TEST_P(MessageLoopTypedTest, RecursivePosts) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/810077): This is flaky on Fuchsia.
#define MAYBE_RecursivePosts DISABLED_RecursivePosts
#else
#define MAYBE_RecursivePosts RecursivePosts
#endif
TEST_P(MessageLoopTypedTest, MAYBE_RecursivePosts) {
const int kNumTimes = 1 << 17;
MessageLoop loop(GetMessageLoopType());
loop.task_runner()->PostTask(FROM_HERE,
Expand Down
17 changes: 15 additions & 2 deletions base/metrics/field_trial_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,14 @@ TEST(FieldTrialDeathTest, OneTimeRandomizedTrialWithoutFieldTrialList) {
"");
}

TEST(FieldTrialListTest, TestCopyFieldTrialStateToFlags) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/752368): This is flaky on Fuchsia.
#define MAYBE_TestCopyFieldTrialStateToFlags \
DISABLED_TestCopyFieldTrialStateToFlags
#else
#define MAYBE_TestCopyFieldTrialStateToFlags TestCopyFieldTrialStateToFlags
#endif
TEST(FieldTrialListTest, MAYBE_TestCopyFieldTrialStateToFlags) {
constexpr char kFieldTrialHandleSwitch[] = "test-field-trial-handle";
constexpr char kEnableFeaturesSwitch[] = "test-enable-features";
constexpr char kDisableFeaturesSwitch[] = "test-disable-features";
Expand Down Expand Up @@ -1320,7 +1327,13 @@ TEST(FieldTrialListTest, AssociateFieldTrialParams) {
EXPECT_EQ(2U, new_params.size());
}

TEST(FieldTrialListTest, ClearParamsFromSharedMemory) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/752368): This is flaky on Fuchsia.
#define MAYBE_ClearParamsFromSharedMemory DISABLED_ClearParamsFromSharedMemory
#else
#define MAYBE_ClearParamsFromSharedMemory ClearParamsFromSharedMemory
#endif
TEST(FieldTrialListTest, MAYBE_ClearParamsFromSharedMemory) {
std::string trial_name("Trial1");
std::string group_name("Group1");

Expand Down
9 changes: 8 additions & 1 deletion base/observer_list_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "base/test/scoped_task_environment.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

Expand Down Expand Up @@ -634,7 +635,13 @@ static void ThreadSafeObserverHarness(int num_threads,
}
}

TEST(ObserverListThreadSafeTest, CrossThreadObserver) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/738275): This is flaky on Fuchsia.
#define MAYBE_CrossThreadObserver DISABLED_CrossThreadObserver
#else
#define MAYBE_CrossThreadObserver CrossThreadObserver
#endif
TEST(ObserverListThreadSafeTest, MAYBE_CrossThreadObserver) {
// Use 7 observer threads. Notifications only come from
// the main thread.
ThreadSafeObserverHarness(7, false);
Expand Down
20 changes: 16 additions & 4 deletions base/process/process_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ MULTIPROCESS_TEST_MAIN(CrashingChildProcess) {

// This test intentionally crashes, so we don't need to run it under
// AddressSanitizer.
#if defined(ADDRESS_SANITIZER)
#if defined(ADDRESS_SANITIZER) || defined(OS_FUCHSIA)
// TODO(crbug.com/753490): Access to the process termination reason is not
// implemented in Fuchsia.
#define MAYBE_GetTerminationStatusCrash DISABLED_GetTerminationStatusCrash
#else
#define MAYBE_GetTerminationStatusCrash GetTerminationStatusCrash
Expand Down Expand Up @@ -611,7 +613,14 @@ MULTIPROCESS_TEST_MAIN(TerminatedChildProcess) {
}
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)

TEST_F(ProcessUtilTest, GetTerminationStatusSigKill) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/753490): Access to the process termination reason is not
// implemented in Fuchsia.
#define MAYBE_GetTerminationStatusSigKill DISABLED_GetTerminationStatusSigKill
#else
#define MAYBE_GetTerminationStatusSigKill GetTerminationStatusSigKill
#endif
TEST_F(ProcessUtilTest, MAYBE_GetTerminationStatusSigKill) {
const std::string signal_file =
ProcessUtilTest::GetSignalFilePath(kSignalFileKill);
remove(signal_file.c_str());
Expand Down Expand Up @@ -644,7 +653,10 @@ TEST_F(ProcessUtilTest, GetTerminationStatusSigKill) {
remove(signal_file.c_str());
}

#if defined(OS_POSIX) || defined(OS_FUCHSIA)
#if defined(OS_POSIX)
// TODO(crbug.com/753490): Access to the process termination reason is not
// implemented in Fuchsia. Unix signals are not implemented in Fuchsia so this
// test might not be relevant anyway.
TEST_F(ProcessUtilTest, GetTerminationStatusSigTerm) {
const std::string signal_file =
ProcessUtilTest::GetSignalFilePath(kSignalFileTerm);
Expand All @@ -669,7 +681,7 @@ TEST_F(ProcessUtilTest, GetTerminationStatusSigTerm) {
EXPECT_EQ(SIGTERM, signal);
remove(signal_file.c_str());
}
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
#endif // defined(OS_POSIX)

TEST_F(ProcessUtilTest, EnsureTerminationUndying) {
test::ScopedTaskEnvironment task_environment;
Expand Down
12 changes: 9 additions & 3 deletions base/synchronization/condition_variable_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ TEST_F(ConditionVariableTest, DISABLED_TimeoutAcrossSetTimeOfDay) {
}
#endif


// Suddenly got flaky on Win, see http://crbug.com/10607 (starting at
// comment #15).
#if defined(OS_WIN)
// This is also flaky on Fuchsia, see http://crbug.com/738275.
#if defined(OS_WIN) || defined(OS_FUCHSIA)
#define MAYBE_MultiThreadConsumerTest DISABLED_MultiThreadConsumerTest
#else
#define MAYBE_MultiThreadConsumerTest MultiThreadConsumerTest
Expand Down Expand Up @@ -398,7 +398,13 @@ TEST_F(ConditionVariableTest, MAYBE_MultiThreadConsumerTest) {
queue.ThreadSafeCheckShutdown(kThreadCount));
}

TEST_F(ConditionVariableTest, LargeFastTaskTest) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/751894): This flakily times out on Fuchsia.
#define MAYBE_LargeFastTaskTest DISABLED_LargeFastTaskTest
#else
#define MAYBE_LargeFastTaskTest LargeFastTaskTest
#endif
TEST_F(ConditionVariableTest, MAYBE_LargeFastTaskTest) {
const int kThreadCount = 200;
WorkQueue queue(kThreadCount); // Start the threads.

Expand Down
18 changes: 16 additions & 2 deletions base/sys_info_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,28 @@ TEST_F(SysInfoTest, MAYBE_AmountOfAvailablePhysicalMemory) {
}
#endif // defined(OS_LINUX) || defined(OS_ANDROID)

TEST_F(SysInfoTest, AmountOfFreeDiskSpace) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/851734): Implementation depends on statvfs, which is not
// implemented on Fuchsia
#define MAYBE_AmountOfFreeDiskSpace DISABLED_AmountOfFreeDiskSpace
#else
#define MAYBE_AmountOfFreeDiskSpace AmountOfFreeDiskSpace
#endif
TEST_F(SysInfoTest, MAYBE_AmountOfFreeDiskSpace) {
// We aren't actually testing that it's correct, just that it's sane.
FilePath tmp_path;
ASSERT_TRUE(GetTempDir(&tmp_path));
EXPECT_GE(SysInfo::AmountOfFreeDiskSpace(tmp_path), 0) << tmp_path.value();
}

TEST_F(SysInfoTest, AmountOfTotalDiskSpace) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/851734): Implementation depends on statvfs, which is not
// implemented on Fuchsia
#define MAYBE_AmountOfTotalDiskSpace DISABLED_AmountOfTotalDiskSpace
#else
#define MAYBE_AmountOfTotalDiskSpace AmountOfTotalDiskSpace
#endif
TEST_F(SysInfoTest, MAYBE_AmountOfTotalDiskSpace) {
// We aren't actually testing that it's correct, just that it's sane.
FilePath tmp_path;
ASSERT_TRUE(GetTempDir(&tmp_path));
Expand Down
8 changes: 7 additions & 1 deletion base/threading/platform_thread_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,13 @@ class ThreadPriorityTestThread : public FunctionTestThread {

// Test changing a created thread's priority (which has different semantics on
// some platforms).
TEST(PlatformThreadTest, ThreadPriorityCurrentThread) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/851759): Thread priorities are not implemented in Fuchsia.
#define MAYBE_ThreadPriorityCurrentThread DISABLED_ThreadPriorityCurrentThread
#else
#define MAYBE_ThreadPriorityCurrentThread ThreadPriorityCurrentThread
#endif
TEST(PlatformThreadTest, MAYBE_ThreadPriorityCurrentThread) {
const bool increase_priority_allowed =
PlatformThread::CanIncreaseCurrentThreadPriority();

Expand Down
17 changes: 15 additions & 2 deletions base/trace_event/process_memory_dump_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,13 @@ TEST(ProcessMemoryDumpTest, GuidsTest) {
}

#if defined(COUNT_RESIDENT_BYTES_SUPPORTED)
TEST(ProcessMemoryDumpTest, CountResidentBytes) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/851760): Counting resident bytes is not supported on Fuchsia.
#define MAYBE_CountResidentBytes DISABLED_CountResidentBytes
#else
#define MAYBE_CountResidentBytes CountResidentBytes
#endif
TEST(ProcessMemoryDumpTest, MAYBE_CountResidentBytes) {
const size_t page_size = ProcessMemoryDump::GetSystemPageSize();

// Allocate few page of dirty memory and check if it is resident.
Expand All @@ -493,7 +499,14 @@ TEST(ProcessMemoryDumpTest, CountResidentBytes) {
Unmap(memory2, kVeryLargeMemorySize);
}

TEST(ProcessMemoryDumpTest, CountResidentBytesInSharedMemory) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/851760): Counting resident bytes is not supported on Fuchsia.
#define MAYBE_CountResidentBytesInSharedMemory \
DISABLED_CountResidentBytesInSharedMemory
#else
#define MAYBE_CountResidentBytesInSharedMemory CountResidentBytesInSharedMemory
#endif
TEST(ProcessMemoryDumpTest, MAYBE_CountResidentBytesInSharedMemory) {
#if defined(OS_IOS)
// TODO(crbug.com/748410): Reenable this test.
if (!base::ios::IsRunningOnIOS10OrLater()) {
Expand Down
9 changes: 8 additions & 1 deletion base/trace_event/trace_category_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "base/threading/thread.h"
#include "base/trace_event/category_registry.h"
#include "base/trace_event/trace_category.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
Expand Down Expand Up @@ -119,7 +120,13 @@ TEST_F(TraceCategoryTest, Basic) {

// Tries to cover the case of multiple threads creating the same category
// simultaneously. Should never end up with distinct entries with the same name.
TEST_F(TraceCategoryTest, ThreadRaces) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/738275): This is flaky on Fuchsia.
#define MAYBE_ThreadRaces DISABLED_ThreadRaces
#else
#define MAYBE_ThreadRaces ThreadRaces
#endif
TEST_F(TraceCategoryTest, MAYBE_ThreadRaces) {
const int kNumThreads = 32;
std::unique_ptr<Thread> threads[kNumThreads];
for (int i = 0; i < kNumThreads; i++) {
Expand Down
43 changes: 0 additions & 43 deletions testing/buildbot/filters/fuchsia.base_unittests.filter
Original file line number Diff line number Diff line change
@@ -1,44 +1 @@
# TODO(fuchsia): Being ported, see https://crbug.com/706592.

-FileProxyTest.SetTimes
-FileUtilTest.FileToFILE
-PlatformThreadTest.ThreadPriorityCurrentThread
-ProcessMemoryDumpTest.CountResidentBytes
-ProcessMemoryDumpTest.CountResidentBytesInSharedMemory
-ProcessMemoryDumpTest.TakeAllDumpsFrom
-SysInfoTest.AmountOfFreeDiskSpace
-SysInfoTest.AmountOfMem
-SysInfoTest.AmountOfTotalDiskSpace

# These tests all rely on being able to set the exit code of an externally
# terminated process, which mx_task_kill() does not support.
# https://crbug.com/753490.
-ProcessTest.WaitForExitWithTimeout
-ProcessUtilTest.GetTerminationStatusCrash
-ProcessUtilTest.GetTerminationStatusSigKill
-ProcessUtilTest.GetTerminationStatusSigTerm

# These tests are occasionally flaking. See https://crbug.com/738275. Please be
# pretty confident you've fixed their rarely-flakiness before re-enabling.
-AllocationRegisterTest.InsertRemoveRandomOrder
-ConditionVariableTest.MultiThreadConsumerTest
-MemoryPeakDetectorTest.StdDev
-MemoryPeakDetectorTest.Throttle
-ObserverListThreadSafeTest.CrossThreadObserver
-TraceCategoryTest.ThreadRaces

# https://crbug.com/751894
-ConditionVariableTest.LargeFastTaskTest

# https://crbug.com/752368.
-FieldTrialListTest.ClearParamsFromSharedMemory
-FieldTrialListTest.TestCopyFieldTrialStateToFlags

# Flaky, https://crbug.com/810077.
-MessageLoopTypedTest.RecursivePosts/*

# Flaky, https://crbug.com/811881
-AddressSpaceRandomizationTest.RandomBitCorrelations*

# Too slow due to QEMU overheads, https://crbug.com/844416
-FileUtilMultiThreadedTest.MultiThreadedTempFiles

0 comments on commit 62c7155

Please sign in to comment.