diff options
author | Vijay Pai <vpai@google.com> | 2016-01-20 11:40:45 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-01-20 11:40:45 -0800 |
commit | 3b10503c42ae83daa3513a396142ed9ee972188f (patch) | |
tree | db1458f76c635a269c50b99181392c71fe3459df /test | |
parent | 9c8ec0506d729fe8bdf9f9e7a514c51995a5206c (diff) | |
parent | f08dc479354820b158bba007cb462045e02dae21 (diff) |
Merge pull request #4781 from ctiller/flingcap
Cap fling tests by time not rpcs processed
Diffstat (limited to 'test')
-rw-r--r-- | test/core/fling/client.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/core/fling/client.c b/test/core/fling/client.c index 99b30d6c4a..95e2ea1f10 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -201,13 +201,16 @@ int main(int argc, char **argv) { sc.init(); - for (i = 0; i < 1000; i++) { + gpr_timespec end_warmup = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3); + gpr_timespec end_profiling = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30); + + while (gpr_time_cmp(gpr_now(end_warmup.clock_type), end_warmup) < 0) { sc.do_one_step(); } gpr_log(GPR_INFO, "start profiling"); grpc_profiler_start("client.prof"); - for (i = 0; i < 100000; i++) { + while (gpr_time_cmp(gpr_now(end_profiling.clock_type), end_profiling) < 0) { start = now(); sc.do_one_step(); stop = now(); |