Fix failed test

Summary: Fix failed persistent cache test introduced by recent PR to support cross-platform build.

Test Plan: Run persistent_cache_test (on multiple platforms)

Reviewers: sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D61467
main
omegaga 9 years ago
parent 4990c0d1a5
commit 8234faabfd
  1. 7
      utilities/persistent_cache/block_cache_tier.h
  2. 3
      utilities/persistent_cache/persistent_cache_tier.h

@ -68,11 +68,8 @@ class BlockCacheTier : public PersistentCacheTier {
void TEST_Flush() override { void TEST_Flush() override {
while (insert_ops_.Size()) { while (insert_ops_.Size()) {
#ifdef OS_WIN /* sleep override */
Sleep(1000); Env::Default()->SleepForMicroseconds(1000000);
#else
/* sleep override */ sleep(1);
#endif
} }
} }

@ -200,7 +200,8 @@ struct PersistentCacheConfig {
// file size in order to avoid dead lock. // file size in order to avoid dead lock.
size_t write_buffer_count() const { size_t write_buffer_count() const {
assert(write_buffer_size); assert(write_buffer_size);
return (writer_qdepth + writer_qdepth/5) * cache_file_size / write_buffer_size; return static_cast<size_t>((writer_qdepth + 1.2) * cache_file_size /
write_buffer_size);
} }
// writer-dispatch-size // writer-dispatch-size

Loading…
Cancel
Save