Skip to content

Give sufficient time to get inference statistics for batcher tests #5699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions qa/L0_batcher/batcher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,21 @@ def check_setup(self, model_name, preferred_batch_sizes,

def check_status(self, model_name, batch_exec, request_cnt, infer_cnt,
exec_count):
stats = self.triton_client_.get_inference_statistics(model_name, "1")
self.assertEqual(len(stats.model_stats), 1, "expect 1 model stats")
# There is a time window between when responses are returned and statistics are updated.
# To prevent intermittent test failure during that window, wait up to 10 seconds for the
# inference statistics to be ready.
num_tries = 10
for i in range(num_tries):
stats = self.triton_client_.get_inference_statistics(
model_name, "1")
self.assertEqual(len(stats.model_stats), 1, "expect 1 model stats")
actual_exec_cnt = stats.model_stats[0].execution_count
if actual_exec_cnt == exec_count:
break
print("WARNING: expect {} executions, got {} (attempt {})".format(
exec_count, actual_exec_cnt, i))
time.sleep(1)

self.assertEqual(stats.model_stats[0].name, model_name,
"expect model stats for model {}".format(model_name))
self.assertEqual(
Expand Down