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 `>=`.
  • Loading branch information
flrgh authored Aug 22, 2024
1 parent 5f68365 commit 58c580f
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

1 comment on commit 58c580f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:58c580f420590644c569f52460c331f7958c3950
Artifacts available https://github.com/Kong/kong/actions/runs/10517413831

Please sign in to comment.