From 8b5ffa61cb47835504f0f21118ed1975473518fb Mon Sep 17 00:00:00 2001 From: Ken Cain Date: Mon, 22 Jan 2024 09:25:34 -0500 Subject: [PATCH] DAOS-13584 tests: limit pool query test time (#12451) (#13578) Signed-off-by: Wang Shilong --- src/tests/suite/daos_md_replication.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/tests/suite/daos_md_replication.c b/src/tests/suite/daos_md_replication.c index efec7d5462c..1c10bae3d4b 100644 --- a/src/tests/suite/daos_md_replication.c +++ b/src/tests/suite/daos_md_replication.c @@ -76,7 +76,9 @@ mdr_stop_pool_svc(void **argv) } else { int n = 10000 / arg->rank_size; int i; + uint64_t t_start, t_end, duration = 0; + t_start = daos_get_ntime(); /* Generate some concurrent requests. */ print_message("repeating %d queries: begin\n", n); for (i = 0; i < n; i++) { @@ -85,8 +87,19 @@ mdr_stop_pool_svc(void **argv) NULL /* properties */, NULL /* ev */); assert_rc_equal(rc, 0); + if (i % 10 == 0) { + t_end = daos_get_ntime(); + duration = (t_end - t_start) / NSEC_PER_SEC; + if (duration >= 15) + break; + } } - print_message("repeating %d queries: end\n", n); + if (duration == 0) { + t_end = daos_get_ntime(); + duration = (t_end - t_start) / NSEC_PER_SEC; + } + print_message("repeating %d queries, duration: %lu seconds end\n", + i, duration); } par_barrier(PAR_COMM_WORLD);