OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <process.h> | 6 #include <process.h> |
7 #include <windows.h> | 7 #include <windows.h> |
8 #endif | 8 #endif |
9 | 9 |
10 #include "base/platform_thread.h" | 10 #include "base/platform_thread.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 zero_counter.Set(0); | 183 zero_counter.Set(0); |
184 lucky13_counter.Set(1313); | 184 lucky13_counter.Set(1313); |
185 increment_counter.Increment(); | 185 increment_counter.Increment(); |
186 decrement_counter.Decrement(); | 186 decrement_counter.Decrement(); |
187 PlatformThread::Sleep(index % 10); // short wait | 187 PlatformThread::Sleep(index % 10); // short wait |
188 } | 188 } |
189 return 0; | 189 return 0; |
190 } | 190 } |
191 | 191 |
192 // Create a few processes and have them poke on their counters. | 192 // Create a few processes and have them poke on their counters. |
193 TEST_F(StatsTableTest, MultipleProcesses) { | 193 // This test is slow and flaky http://crbug.com/10611 |
| 194 TEST_F(StatsTableTest, FLAKY_MultipleProcesses) { |
194 // Create a stats table. | 195 // Create a stats table. |
195 const int kMaxProcs = 20; | 196 const int kMaxProcs = 20; |
196 const int kMaxCounter = 5; | 197 const int kMaxCounter = 5; |
197 DeleteShmem(kMPTableName); | 198 DeleteShmem(kMPTableName); |
198 StatsTable table(kMPTableName, kMaxProcs, kMaxCounter); | 199 StatsTable table(kMPTableName, kMaxProcs, kMaxCounter); |
199 StatsTable::set_current(&table); | 200 StatsTable::set_current(&table); |
200 EXPECT_EQ(0, table.CountThreadsRegistered()); | 201 EXPECT_EQ(0, table.CountThreadsRegistered()); |
201 | 202 |
202 // Spin up a set of processes to go bang on the various counters. | 203 // Spin up a set of processes to go bang on the various counters. |
203 // After we join the processes, we'll make sure the counters | 204 // After we join the processes, we'll make sure the counters |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 PlatformThread::Sleep(500); | 398 PlatformThread::Sleep(500); |
398 } | 399 } |
399 EXPECT_LE(1000, table.GetCounterValue("t:foo")); | 400 EXPECT_LE(1000, table.GetCounterValue("t:foo")); |
400 EXPECT_LE(1000, table.GetCounterValue("t:bar")); | 401 EXPECT_LE(1000, table.GetCounterValue("t:bar")); |
401 EXPECT_EQ(2, table.GetCounterValue("c:bar")); | 402 EXPECT_EQ(2, table.GetCounterValue("c:bar")); |
402 | 403 |
403 DeleteShmem(kTableName); | 404 DeleteShmem(kTableName); |
404 } | 405 } |
405 | 406 |
406 } // namespace base | 407 } // namespace base |
OLD | NEW |