Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: net/disk_cache/entry_unittest.cc

Issue 341006: Don't hang during DiskCacheEntryTest.CancelSparseIO on infinitely fast disks.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/entry_unittest.cc
===================================================================
--- net/disk_cache/entry_unittest.cc (Revision 30242)
+++ net/disk_cache/entry_unittest.cc (Arbeitskopie)
@@ -1356,8 +1356,16 @@
SimpleCallbackTest cb1, cb2, cb3, cb4;
int64 offset = 0;
- for (int ret = 0; ret != net::ERR_IO_PENDING; offset += kSize * 4)
+ int tries = 0;
+ const int maxtries = 1000; // Avoid hang on infinitely fast disks
rvargas (doing something else) 2009/10/27 23:04:58 Are you sure you want to have a number that high?
+ for (int ret = 0; ret != net::ERR_IO_PENDING; offset += kSize * 4) {
ret = entry->WriteSparseData(offset, buf, kSize, &cb1);
+ if (++tries > maxtries) {
+ LOG(ERROR) << "Data writes never come back PENDING; skipping test";
+ entry->Close();
+ return;
+ }
+ }
// Cannot use the entry at this point.
offset = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698