Make rate limiting unit test more robust

This commit is contained in:
Igor Canadi 2014-03-27 11:53:05 -07:00
parent 1c9f8f0884
commit 5826f9528f
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ Options::Options()
purge_redundant_kvs_while_flush(true),
allow_os_buffer(true),
allow_mmap_reads(false),
allow_mmap_writes(true),
allow_mmap_writes(false),
is_fd_close_on_exec(true),
skip_log_error_on_recovery(false),
stats_dump_period_sec(3600),

View File

@ -826,7 +826,7 @@ TEST(BackupableDBTest, RateLimiting) {
auto rate_limited_backup_time = (bytes_written * kMicrosPerSec) /
backupable_options_->backup_rate_limit;
ASSERT_GT(backup_time, 0.9 * rate_limited_backup_time);
ASSERT_LT(backup_time, 1.3 * rate_limited_backup_time);
ASSERT_LT(backup_time, 1.5 * rate_limited_backup_time);
CloseBackupableDB();
@ -838,7 +838,7 @@ TEST(BackupableDBTest, RateLimiting) {
auto rate_limited_restore_time = (bytes_written * kMicrosPerSec) /
backupable_options_->restore_rate_limit;
ASSERT_GT(restore_time, 0.9 * rate_limited_restore_time);
ASSERT_LT(restore_time, 1.3 * rate_limited_restore_time);
ASSERT_LT(restore_time, 1.5 * rate_limited_restore_time);
AssertBackupConsistency(0, 0, 100000, 100010);
}