Skip to content

Commit

Permalink
tests(ai-plugins): fix flaky latency assertion (#13558)
Browse files Browse the repository at this point in the history
The way this latency is measured in the code is not granular enough to
guarantee that it will always produce a non-zero result, so the
assertion is changed from `>` to `>=`.

(cherry picked from commit 58c580f)
  • Loading branch information
flrgh authored and github-actions[bot] committed Aug 23, 2024
1 parent 64c1bec commit 02daa6e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ for _, strategy in helpers.all_strategies() do if strategy ~= "cassandra" then
log_message.ai["ai-response-transformer"].usage.time_per_token = 1

assert.same(_EXPECTED_CHAT_STATS, log_message.ai)
assert.is_true(actual_llm_latency > 0)
assert.is_true(actual_llm_latency >= 0)
assert.same(actual_time_per_token, time_per_token)
end)

Expand Down

0 comments on commit 02daa6e

Please sign in to comment.