Commit 728c0bca authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:4074] Closes #4074 Make minicron-test insensitive to a delayed clock tick...

[t:4074] Closes #4074 Make minicron-test insensitive to a delayed clock tick (and explain why in a comment in the code).

git-svn-id: file:///svn/toku/tokudb@36190 c7de825b-a66e-492c-adef-691d508d4ae1
parent f5c8ab0a
...@@ -64,9 +64,13 @@ run_5x (void *v) { ...@@ -64,9 +64,13 @@ run_5x (void *v) {
struct timeval now; struct timeval now;
gettimeofday(&now, 0); gettimeofday(&now, 0);
double diff = tdiff(&now, &tx->tv); double diff = tdiff(&now, &tx->tv);
if (verbose) printf("T=%f\n", diff); if (verbose) printf("T=%f tx->counter=%d\n", diff, tx->counter);
assert(diff>0.5 + tx->counter); // We only verify that the timer was not premature.
assert(diff<1.5 + tx->counter); // Sometimes it will be delayed, but there's no good way to test it and nothing we can do about it.
if (!(diff>0.5 + tx->counter)) {
printf("T=%f tx->counter=%d\n", diff, tx->counter);
assert(0);
}
tx->counter++; tx->counter++;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment