Skip to content

Commit

Permalink
tests(ai-plugins): fix flaky latency assertion (part 2)
Browse files Browse the repository at this point in the history
Applies the same fix as 58c580f to similar tests.
  • Loading branch information
flrgh committed Aug 23, 2024
1 parent 846f222 commit b70c138
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions spec/03-plugins/38-ai-proxy/02-openai_integration_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ for _, strategy in helpers.all_strategies() do if strategy ~= "cassandra" then
first_got.usage.time_per_token = 1

assert.same(first_expected, first_got)
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 Expand Up @@ -1409,7 +1409,7 @@ for _, strategy in helpers.all_strategies() do if strategy ~= "cassandra" then
},
body = pl_file.read("spec/fixtures/ai-proxy/openai/llm-v1-chat/requests/good_multi_modal.json"),
})

-- validate that the request succeeded, response status 200
local body = assert.res_status(200 , r)
local json = cjson.decode(body)
Expand Down Expand Up @@ -1444,7 +1444,7 @@ for _, strategy in helpers.all_strategies() do if strategy ~= "cassandra" then
first_got.usage.time_per_token = 1

assert.same(first_expected, first_got)
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
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ for _, strategy in helpers.all_strategies() do if strategy ~= "cassandra" then
log_message.ai["ai-request-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 b70c138

Please sign in to comment.