Merge pull request #17220 from amitkumar50/cov-test-2

test: Check to avoid divide by zero

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-08-29 15:59:32 -05:00 committed by GitHub
commit 8245a8da42

View File

@ -115,7 +115,9 @@ int KvStoreBench::setup(int argc, const char** argv) {
} else if (strcmp(args[i], "--cache-size") == 0) {
cache_size = atoi(args[i+1]);
} else if (strcmp(args[i], "--cache-refresh") == 0) {
cache_refresh = 100 / atoi(args[i+1]);
auto temp = atoi(args[i+1]);
assert (temp != 0);
cache_refresh = 100 / temp;
} else if (strcmp(args[i], "-t") == 0) {
max_ops_in_flight = atoi(args[i+1]);
} else if (strcmp(args[i], "--clients") == 0) {